Пример #1
0
 public void TowersAction()
 {
     for (int i = 0; i < GameUtils.PLAYER_COUNT; i++)
     {
         ITowerIterator iterator = _game.players[i].Towers.CreateIterator();
         for (EnemyAttacker tower = iterator.First(); !iterator.IsDone; tower = iterator.Next())
         {
             tower.TowerAction.Action(tower, _game.players[i]);
         }
     }
 }
Пример #2
0
        private EnemyAttacker GetTower(Player player, int towerId)
        {
            ITowerIterator iterator = player.Towers.CreateIterator();

            for (EnemyAttacker tower = iterator.First(); !iterator.IsDone; tower = iterator.Next())
            {
                if (tower.Id == towerId)
                {
                    return(tower);
                }
            }
            return(null);
        }