Example #1
0
        private Wagon SearchForAvaibleWagon(Animal animal)
        {
            foreach (Wagon wagon in _wagons)
            {
                if (wagon.CanAnimalBePlaced(animal))
                {
                    return(wagon);
                }
            }

            Wagon newWagon = new Wagon();

            AddWagon(newWagon);
            return(newWagon);
        }
Example #2
0
 private void AddWagon(Wagon wagon)
 {
     _wagons.Add(wagon);
 }