public override void HandleInput() { int nbr; string choice = Console.ReadLine(); City city = CurrentGame().GetCity(); ArmyManager build = CurrentGame().GetCity().GetArmies(); switch(choice){ case "1" : nbr = unitNumber(); city.SetGold(new Gold(city.GetGold().GetAmount()-nbr)); city.SetFood(new Food(city.GetFood().GetAmount()-10*nbr)); build.CreateArcherArmy(nbr); break; case "2" : nbr = unitNumber(); city.SetGold(new Gold(city.GetGold().GetAmount()-nbr)); city.SetFood(new Food(city.GetFood().GetAmount()-5*nbr)); build.CreateKnightsArmy(nbr); break; case "3" : nbr = unitNumber(); city.SetGold(new Gold(city.GetGold().GetAmount()-nbr*2)); city.SetFood(new Food(city.GetFood().GetAmount()-12*nbr)); build.CreateWizardsArmy(nbr); break; case "4" : PopMenu(); break; default : this.Display(); break; } }
public void SetArmies(ArmyManager armies) { this.armies = armies; }
public City() { this.armies = new ArmyManager(); this.gold = new Gold(); this.food = new Food(); }