/// <summary> /// Insert building's action queue to build something /// </summary> public void TellSelectedBuildingToBuild() { List <ModelComponent> selectedEntities = getGameModel().GetSelectionState().SelectedEntities; if (selectedEntities.Count > 0 && selectedEntities[0] is Building) { Building b = (Building)selectedEntities[0]; ProduceUnit produceAction = null; if (b.Type.Equals("house")) { produceAction = new ZRTSModel.ProduceUnit(b, "worker"); } else { produceAction = new ZRTSModel.ProduceUnit(b, "soldier"); } b.BuildingActionQueue.AddChild(produceAction); } }
/// <summary> /// Insert building's action queue to build something /// </summary> public void TellSelectedBuildingToBuild() { List<ModelComponent> selectedEntities = getGameModel().GetSelectionState().SelectedEntities; if (selectedEntities.Count > 0 && selectedEntities[0] is Building) { Building b = (Building)selectedEntities[0]; ProduceUnit produceAction= null; if (b.Type.Equals("house")) { produceAction = new ZRTSModel.ProduceUnit(b, "worker"); } else { produceAction = new ZRTSModel.ProduceUnit(b, "soldier"); } b.BuildingActionQueue.AddChild(produceAction); } }