예제 #1
0
        public string ProcessSettleCommand(List <string> args)
        {
            string name         = args[0];
            int    age          = int.Parse(args[1]);
            int    productivity = int.Parse(args[2]);
            string villageName  = args[3];

            Peasant peasant = new Peasant(name, age, productivity);

            Village village = GetVillage(villageName);

            village.AddPeasant(peasant);

            return($"Settled Peasant {name} in Village {villageName}!");
        }
예제 #2
0
 public void AddPeasant(Peasant peasant)
 {
     peasants.Add(peasant);
 }