예제 #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>();
        }
예제 #2
0
 public AttackingTowersIterator(TowersCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }
예제 #3
0
 public RegeneratingTowersIterator(TowersCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }