public void QueueBuildCommand() { BuildPlotLocation location = selectedBuildPlotManager.GetSelectedLocation(); GameBehaviourCommand command = BuildingCommandFactory.CreateConstructBuildingCommand(location, buildingType, PlayerType.PLAYER); QueueUpCommand(command); }
public AI_GameBehaviourCommand GetBuildingCommand(BuildingModel model) { BuildPlotController buildPlotController = GetBuildPlotController(); BuildingType buildingType = model.type; foreach (BuildPlotLocation location in Enum.GetValues(typeof(BuildPlotLocation)).Cast <BuildPlotLocation>()) { BuildingType buildingOnPlot = buildPlotController.buildPlotMap.GetBuilding(location); if (buildingOnPlot == BuildingType.NONE) { GameBehaviourCommand command = BuildingCommandFactory.CreateConstructBuildingCommand(location, buildingType, PlayerType.AI); AI_GameBehaviourCommand aiCommand = new AI_GameBehaviourCommand(command, model.buildCost, model.constructionTime); return(aiCommand); } } // No building commmand return(null); }