Пример #1
0
        public Wagon GetAvailableWagon(Animal animal)
        {
            foreach (Wagon wagon in wagons)
            {
                if (wagon.CanAnimalBeAdded(animal))
                {
                    return(wagon);
                }
            }

            Wagon newWagon = new Wagon();

            wagons.Add(newWagon);
            return(newWagon);
        }
Пример #2
0
 public void AddWagonToTrain(Wagon wagon)
 {
     wagons.Add(wagon);
 }