Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4404 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 30, 2005, 6:27:45 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: player now is a EventListener for particular events

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/event/event.h

    r4381 r4404  
    1515
    1616//! An abstract event class
    17 class Event : public BaseObject {
     17class Event : virtual public BaseObject {
    1818
    1919 public:
  • orxonox/trunk/src/util/event/event_listener.h

    r4365 r4404  
    1414
    1515//! A class for event listener
    16 class EventListener : public BaseObject {
     16class EventListener : virtual public BaseObject {
    1717
    1818 public:
  • orxonox/trunk/src/world_entities/player.cc

    r4397 r4404  
    2828#include "stdincl.h"
    2929
     30#include "event_handler.h"
    3031
    3132#include "projectile.h"
     33#include "event.h"
    3234
    3335using namespace std;
     
    6567}
    6668
     69
    6770/**
    6871   \brief destructs the player, deletes alocated memory
     
    7679  delete this->weaponMan;
    7780}
     81
    7882
    7983/**
     
    110114}
    111115
     116
    112117/**
    113118   \brief adds a weapon to the weapon list of player
     
    275280  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
    276281}
     282
     283
     284void Player::process(const Event &event)
     285{
     286
     287}
  • orxonox/trunk/src/world_entities/player.h

    r4382 r4404  
    99#include "world_entity.h"
    1010#include "physics_interface.h"
     11#include "event_listener.h"
    1112
    1213template<class T> class tList;
     
    1516class Vector;
    1617class World;
     18class Event;
    1719
    1820//! Basic controllable WorldEntity
    19 class Player : public WorldEntity, public PhysicsInterface
     21class Player : public WorldEntity, public PhysicsInterface, public EventListener
    2022{
    2123  friend class World;
     
    3840
    3941  virtual void command(Command* cmd);
     42
     43  virtual void process(const Event &event);
    4044 
    4145 private:
Note: See TracChangeset for help on using the changeset viewer.