public void AddWall(Vector2 position, Rectangle textureOffset) { if (ManagerResources.CompareGold(managerUnits.index, 100)) { ManagerResources.ReduceGold(managerUnits.index, 100); managerUnits.managerMap.AddWalls(position, textureOffset); } }
public bool execute() { if (!go && ManagerResources.CompareGold(managerUnits.index, informationUnit.CostGold) && ManagerResources.CompareFood(managerUnits.index, informationUnit.CostFood)) { ManagerResources.ReduceGold(managerUnits.index, informationUnit.CostGold); ManagerResources.ReduceFood(managerUnits.index, informationUnit.CostFood); go = true; completed = false; remove = false; return(true); } return(false); }
public bool execute() { if (ManagerResources.CompareGold(managerUnits.index, building.information.CostGold)) // && ManagerResources.CompareFood(managerUnits.index, building.information.CostWood)) { ManagerResources.ReduceGold(managerUnits.index, building.information.CostGold); if ((building.information as InformationBuilding).Type == Util.Buildings.CHICKEN_FARM || (building.information as InformationBuilding).Type == Util.Buildings.PIG_FARM) { ManagerResources.ReduceFood(managerUnits.index, -5); } builder.workState = WorkigState.WAITING_PLACE; building.builder(); return(true); } return(false); }