Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7346 in orxonox.OLD for trunk/src/world_entities/playable.h


Ignore:
Timestamp:
Apr 19, 2006, 1:17:46 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: extreme cleanup in Playable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.h

    r7339 r7346  
    2727{
    2828public:
     29  //! Defines the Playmode of an Entity.
    2930  typedef enum {
    30     Vertical         = 1,
    31     Horizontal       = 2,
    32     FromBehind       = 4,
    33     Full3D           = 8,
     31    Vertical         = 1,       //!< Vertical (seen from left or right/move in x-z)
     32    Horizontal       = 2,       //!< Horizontal (seet from the top/move in x-y)
     33    FromBehind       = 4,       //!< Seen from behind (move in z-y)
     34    Full3D           = 8,       //!< Full featured 3D-mode. (move in all directions x-y-z)
    3435  } Playmode;
    3536
     
    4041  virtual void loadParams(const TiXmlElement* root);
    4142
    42   virtual void die();
    43   virtual void respawn();
    44 
     43  // Weapon and Pickups
    4544  virtual bool pickup(PowerUp* powerUp);
    46 
    4745  void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
    4846  void removeWeapon(Weapon* weapon);
    4947  void nextWeaponConfig();
    5048  void previousWeaponConfig();
    51 
    5249  inline WeaponManager& getWeaponManager() { return this->weaponMan; };
    5350  void weaponConfigChanged();
    5451
    5552
     53  // Player Settup
    5654  bool setPlayer(Player* player);
    5755  Player* getCurrentPlayer() const { return this->currentPlayer; };
     56  /** @return a List of Events in PEV_* sytle */
     57  inline const std::vector<int>& getEventList() { return this->events; };
    5858
     59  // Camera and Playmode
    5960  void attachCamera();
    6061  void detachCamera();
     
    6364  bool setPlaymode(Playable::Playmode playmode);
    6465  Playable::Playmode getPlaymode() const { return this->playmode; };
     66  virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) = 0;
     67  void setPlayDirection(float angle, float dirX, float dirY, float dirZ, float speed = 0.0f);
    6568
     69  inline void setScore( int score ) { this->score = score; }
     70  inline int  getScore() { return this->score; }
     71
     72
     73  // WorldEntity Extensions
     74  virtual void die();
     75  virtual void respawn();
    6676  virtual void collidesWith(WorldEntity* entity, const Vector& location);
    6777  virtual void process(const Event &event);
    68 
    6978  virtual void tick(float dt);
    7079
    71   /** @return a List of Events in PEV_* sytle */
    72   inline const std::vector<int>& getEventList() { return this->events; };
    73 
     80  // NETWORK
    7481  int       writeSync(const byte* data, int length, int sender);
    7582  int       readSync(byte* data, int maxLength );
    7683  bool      needsReadSync();
    77 
    78 
    79   //
    80   virtual void setStartDirection(const Quaternion& rot) = 0;
    81   void setStartDirection(float angle, float dirX, float dirY, float dirZ) { this->setStartDirection(Quaternion(angle, Vector(dirX, dirY, dirZ))); }
    82 
    83   inline void setScore( int score ) { this->score = score; }
    84   inline int  getScore() { return this->score; }
    8584
    8685
     
    9190  Playable();
    9291
     92  // Player Setup
    9393  virtual void enter() = 0;
    9494  virtual void leave() = 0;
     95  // Playmode
     96  void setSupportedPlaymodes(short playmodes) { this->supportedPlaymodes = playmodes; };
     97  virtual void enterPlaymode(Playable::Playmode playmode);
    9598
    96   void setSupportedPlaymodes(short playmodes) { this->supportedPlaymodes = playmodes; };
    97 
     99  // Events.
    98100  void registerEvent(int eventType);
    99101  void unregisterEvent(int eventType);
Note: See TracChangeset for help on using the changeset viewer.