Changeset 7346 in orxonox.OLD for trunk/src/world_entities/playable.h
- Timestamp:
- Apr 19, 2006, 1:17:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.h
r7339 r7346 27 27 { 28 28 public: 29 //! Defines the Playmode of an Entity. 29 30 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) 34 35 } Playmode; 35 36 … … 40 41 virtual void loadParams(const TiXmlElement* root); 41 42 42 virtual void die(); 43 virtual void respawn(); 44 43 // Weapon and Pickups 45 44 virtual bool pickup(PowerUp* powerUp); 46 47 45 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 48 46 void removeWeapon(Weapon* weapon); 49 47 void nextWeaponConfig(); 50 48 void previousWeaponConfig(); 51 52 49 inline WeaponManager& getWeaponManager() { return this->weaponMan; }; 53 50 void weaponConfigChanged(); 54 51 55 52 53 // Player Settup 56 54 bool setPlayer(Player* player); 57 55 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; }; 58 58 59 // Camera and Playmode 59 60 void attachCamera(); 60 61 void detachCamera(); … … 63 64 bool setPlaymode(Playable::Playmode playmode); 64 65 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); 65 68 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(); 66 76 virtual void collidesWith(WorldEntity* entity, const Vector& location); 67 77 virtual void process(const Event &event); 68 69 78 virtual void tick(float dt); 70 79 71 /** @return a List of Events in PEV_* sytle */ 72 inline const std::vector<int>& getEventList() { return this->events; }; 73 80 // NETWORK 74 81 int writeSync(const byte* data, int length, int sender); 75 82 int readSync(byte* data, int maxLength ); 76 83 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; }85 84 86 85 … … 91 90 Playable(); 92 91 92 // Player Setup 93 93 virtual void enter() = 0; 94 94 virtual void leave() = 0; 95 // Playmode 96 void setSupportedPlaymodes(short playmodes) { this->supportedPlaymodes = playmodes; }; 97 virtual void enterPlaymode(Playable::Playmode playmode); 95 98 96 void setSupportedPlaymodes(short playmodes) { this->supportedPlaymodes = playmodes; }; 97 99 // Events. 98 100 void registerEvent(int eventType); 99 101 void unregisterEvent(int eventType);
Note: See TracChangeset
for help on using the changeset viewer.