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>(); }
public AttackingTowersIterator(TowersCollection collection) { _collection = collection; _position = -1; }
public RegeneratingTowersIterator(TowersCollection collection) { _collection = collection; _position = -1; }