module dinermenuiterator;

import iterator, menuitem;

class DinerMenuIterator : Iterator
{
    private MenuItem[] items;
    private int position;

    this(MenuItem[] items)
    {
        this.items = items;
    }

    override MenuItem next()
    {
        return items[position++];        
    }

    override bool hasNext()
    {
        return items.length > position;
    }
}
