@Override
	public void onUnitComplete(Unit unit) {
		StartedBuildRequest completed = null;
		for (StartedBuildRequest request : finishedRequests) {
			if (request.getRequest().getUnit().equals(unit.getType())) {
				completed = request;
				break;
			}
		}
		if (completed != null) {
			// Put the unit where it was requested to go.
			if (completed.getRequest().getUnitOutput() != null) {
				completed.getRequest().getUnitOutput().add(unit);
			}
			finishedRequests.remove(completed);
		}
		if (unit.getType() == UnitType.Terran_Barracks) {
			buildings.add(new BuildQueue(unit, UnitType.Terran_Marine));
		}
		if (unit.getType() == UnitType.Terran_Command_Center) {
			buildings.add(new BuildQueue(unit, UnitType.Terran_SCV));
		}

		for (BuildQueue building : buildings) {
			if (building.remove(unit)) {
				break;
			}
		}
	}