public void Setup() {
     lion = new Lion();
     lionActions = new LionActions();
     gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
 }
Beispiel #2
0
 public void Move(Board boardManager, List<IAnimal> animals) {
     foreach (IAnimal animal in animals) {
         if (IsLion(animal)) {
             var lion = (Lion) animal;
             var lionActions = new LionActions();
             bool ate = lionActions.TryToEat(animals, lion);
             if (ate) {
                 continue;
             }
         }
         if (IsAntilope(animal)) {
             var antilope = (Antilope) animal;
             var antilopeActions = new AntilopeActions();
             bool ranAway = antilopeActions.TryToRunAway(animals, boardManager, antilope);
             if (ranAway) {
                 continue;
             }
         }
         MoveCurrentAnimal(boardManager, animals, animal);
     }
 }