#include "Menu.h"

#include <AsynchronCall.h>

Menu::Menu(Bildschirm* zScreen)
    : ReferenceCounter(),
      zScreen(zScreen)
{}

void Menu::show()
{
    for (auto member : elements)
        zScreen->addMember(dynamic_cast<Zeichnung*>(member->getThis()));
}

void Menu::hide()
{
    new AsynchronCall([this]() {
        for (auto member : elements)
            zScreen->removeMember(dynamic_cast<Zeichnung*>(member->getThis()));
    });
}