Exemplo n.º 1
0
        public List <Tower> GetAttackingTowers()
        {
            TowersCollection        towersCollection  = new TowersCollection(GetAllTowers());
            AttackingTowersIterator attackingIterator = (AttackingTowersIterator)towersCollection.GetAttackingIterator();

            List <Tower> attackingTowers = new List <Tower>();

            for (attackingIterator.First(); !attackingIterator.IsDone(); attackingIterator.MoveNext())
            {
                attackingTowers.Add((Tower)attackingIterator.Current());
            }

            return(attackingTowers);
            //GetAllTowers().Where(tower => tower.GetType().BaseType.Equals(typeof(AttackingTower))).ToList<Tower>();
        }
Exemplo n.º 2
0
 public AttackingTowersIterator(TowersCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }
Exemplo n.º 3
0
 public RegeneratingTowersIterator(TowersCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }