PlayerController::~PlayerController() { // Cleanup // Broadcast a "PlayerDestroyed" event Event::CustomEvent PlayerDestroyed("PlayerDestroyed"); Game::instance().broadcastEvent(PlayerDestroyed); }
VirtScreen::VirtScreen(World * const world_, Player * const player_) : w(world_), player(player_) { connect(w, SIGNAL(Notify(const QString &)), this, SLOT(Notify(const QString &))); connect(player, SIGNAL(Notify(const QString &)), this, SLOT(Notify(const QString &))); connect(w, SIGNAL(GetString(QString &)), this, SLOT(PassString(QString &)), Qt::DirectConnection); connect(player, SIGNAL(GetString(QString &)), this, SLOT(PassString(QString &)), Qt::DirectConnection); connect(player, SIGNAL(Updated()), this, SLOT(UpdatePlayer()), Qt::DirectConnection); connect(w, SIGNAL(ReConnect()), this, SLOT(ConnectWorld()), Qt::DirectConnection); connect(w, SIGNAL(UpdatedAll()), this, SLOT(UpdateAll()), Qt::DirectConnection); connect(w, SIGNAL(Moved(const int)), this, SLOT(Move(const int)), Qt::DirectConnection); ConnectWorld(); connect(w, SIGNAL(UpdatesEnded()), this, SLOT(UpdatesEnd()), Qt::DirectConnection); connect( player, SIGNAL( Destroyed() ), this, SLOT( PlayerDestroyed() ), Qt::DirectConnection ); }