Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7866 in orxonox.OLD for branches/gui/src/world_entities


Ignore:
Timestamp:
May 26, 2006, 1:11:10 PM (19 years ago)
Author:
bensch
Message:

Events are subscribed at the EventListener, and not the EventHandler

Location:
branches/gui/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/world_entities/camera.cc

    r7347 r7866  
    3131  this->target = new CameraTarget();
    3232
    33   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW0);
    34   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW1);
    35   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW2);
    36   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW3);
    37   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW4);
    38   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_VIEW5);
     33  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0);
     34  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1);
     35  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW2);
     36  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW3);
     37  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW4);
     38  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5);
    3939
    4040  this->setFovy(90);
  • branches/gui/src/world_entities/playable.cc

    r7713 r7866  
    1616
    1717#include "playable.h"
    18 #include "event_handler.h"
     18
     19#include "key_mapper.h"
    1920
    2021#include "player.h"
     
    225226
    226227    // unsubscibe all events.
    227     EventHandler* evh = EventHandler::getInstance();
    228228    std::vector<int>::iterator ev;
    229229    for (ev = this->events.begin(); ev != events.end(); ev++)
    230       evh->unsubscribe( ES_GAME, (*ev));
     230      player->unsubscribeEvent(ES_GAME, (*ev));
    231231
    232232    // leave the entity
     
    251251
    252252    /*EventHandler*/
    253     EventHandler* evh = EventHandler::getInstance();
    254253    std::vector<int>::iterator ev;
    255254    for (ev = this->events.begin(); ev != events.end(); ev++)
    256       evh->subscribe(player, ES_GAME, (*ev));
     255      player->subscribeEvent(ES_GAME, (*ev));
    257256
    258257    this->enter();
     
    440439
    441440  if (this->currentPlayer != NULL)
    442     EventHandler::getInstance()->subscribe(this->currentPlayer, ES_GAME, eventType);
     441    this->currentPlayer->subscribeEvent(ES_GAME, eventType);
    443442}
    444443
     
    453452
    454453  if (this->currentPlayer != NULL)
    455     EventHandler::getInstance()->unsubscribe(ES_GAME, eventType);
     454    this->currentPlayer->unsubscribeEvent(ES_GAME, eventType);
    456455}
    457456
  • branches/gui/src/world_entities/player.cc

    r7337 r7866  
    4040  this->hud.show();
    4141
    42   EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_CHANGE_SHIP);
     42  this->subscribeEvent(ES_GAME, KeyMapper::PEV_CHANGE_SHIP);
    4343}
    4444
  • branches/gui/src/world_entities/weapons/crosshair.cc

    r7221 r7866  
    6565  this->material = new Material;
    6666
    67   //EventHandler::getInstance()->subscribe(this, ES_GAME, EV_MOUSE_MOTION);
     67  //this->subscribeEvent(ES_GAME, EV_MOUSE_MOTION);
    6868
    6969  // center the mouse on the screen, and also hide the cursors
Note: See TracChangeset for help on using the changeset viewer.