public void AddInumerator(INumerator numerator) { if (numerator != null) { inums.Add(numerator); } if (inums.Count == 1) { Index = 0; } }
static void Main(string[] args) { var hands = new HandHeldInventory(new Sword(), new Shield()); var knapsack = new KnapsackInventory(new List <Item>(new Item[] { new Apple(), new Medicine(), new Potion(), new SpellBook(), new Wand() })); INumerable inventory = knapsack; INumerator numerator = inventory.GetNumerator(); while (!numerator.IsDone()) { Console.WriteLine(numerator.CurrentItem().ToString().Split('.').Last()); numerator.Next(); } }
public VehicleFilter(INumerator prev, ISet <VehicleType> vehicles) : base(prev) { this.vehicles = vehicles; }
public PopulationFilter(INumerator prev, int population) : base(prev) { MinPopulation = population; }
public RestaiurantFilter(INumerator prev, bool Restaurant = false) : base(prev) { this.Restaurant = Restaurant; }
public AbstractDecorator(INumerator prev) { previous = prev; }