public void SetUp() { antilope = new Antilope(); antilopeActions = new AntilopeActions(); gameplay = new Gameplay { Animals = new List<IAnimal>() }; board = new Board(); board.Create(); }
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); } }