예제 #1
0
        public void UpdateGui(GuiManager gui_manager, float dt)
        {
            //Updates all elements from the list in the gui manager
            Iterator <IGuiElement> elementIterator;

            elementIterator = new LinkedListIterator <IGuiElement>(gui_manager.elements);
            elementIterator.getCurrent().Visit(() => Do.Nothing(), (button) => button.Update(this, dt));
            while (elementIterator.hasNext())
            {
                elementIterator.moveNext().Visit(() => Do.Nothing(), button => button.Update(this, dt));
            }
        }
예제 #2
0
        public void DrawGui(GuiManager gui_manager)
        {
            //Draws all elements from the list in the guimanager
            Iterator <IGuiElement> elementIterator;

            elementIterator = new LinkedListIterator <IGuiElement>(gui_manager.elements);
            elementIterator.getCurrent().Visit(() => Do.Nothing(), (button) => button.Draw(this));
            while (elementIterator.getCurrent().Visit(() => false, (element) => true))
            {
                elementIterator.moveNext().Visit(() => Do.Nothing(), button => button.Draw(this));
            }
        }
예제 #3
0
        public static void PlaySong(ILinkedList <Note> song)
        {
            Iterator <Note> SongIterartor = new LinkedListIterator <Note>(song);

            SongIterartor.getCurrent().Visit(() => Do.Nothing(), (note) => note.Visit(() => note.Play(), (duration) => Thread.Sleep(duration)));
            while (SongIterartor.hasNext())
            {
                SongIterartor.moveNext().Visit(() => Console.WriteLine("!!!______END__SONG______!!!"),
                                               (note) => note.Visit(() => note.Play(),
                                                                    (duration) => Thread.Sleep((int)duration)));
            }
        }