#include #include "lobby.h" #include "courtroom.h" #include "networkmanager.h" #include "aoapplication.h" AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv) { net_manager = new NetworkManager(this); } AOApplication::~AOApplication() { destruct_lobby(); destruct_courtroom(); } void AOApplication::construct_lobby() { if (lobby_constructed) { qDebug() << "W: lobby was attempted constructed when it already exists"; return; } w_lobby = new Lobby(this); lobby_constructed = true; } void AOApplication::destruct_lobby() { if(!lobby_constructed) { qDebug() << "W: lobby was attempted destructed when it did not exist"; return; } delete w_lobby; lobby_constructed = false; } void AOApplication::construct_courtroom() { if (courtroom_constructed) { qDebug() << "W: courtroom was attempted constructed when it already exists"; return; } w_courtroom = new Courtroom(this); courtroom_constructed = true; //D3BUG w_courtroom->show(); } void AOApplication::destruct_courtroom() { if (!courtroom_constructed) { qDebug() << "W: courtroom was attempted destructed when it did not exist"; return; } delete w_courtroom; courtroom_constructed = false; }