Beispiel #1
0
 public void GameLoop()
 {
     foreach (Tile T in GetAllTiles())
     {
         if (T.Animal != null) //forskellig fra NULL værdi
         {
             if (T.Animal.Species == 'R')
             {
                 Rabbit rabbit = (Rabbit)T.Animal;
                 rabbit.Move(this);
             }
             else if (T.Animal.Species == 'L')
             {
                 Lion lion = (Lion)T.Animal;
                 lion.Move(this);
             }
         }
     }
 }
Beispiel #2
0
        public void GameLoop(SurvivalController sc)
        {
            TurnCount++;

            foreach (Tile T in sc.GetAllTiles())
            {
                if (T.Animal != null) //forskellig fra NULL værdi
                {
                    if (T.Animal.Species == 'R')
                    {
                        Rabbit rabbit = (Rabbit)T.Animal;
                        rabbit.Move(sc);
                    }
                    else if (T.Animal.Species == 'L')
                    {
                        Rabbit rabbit = (Rabbit)T.Animal;
                        rabbit.Move(sc);
                    }
                }
            }
        }