[2077] | 1 | /*! |
---|
| 2 | \file world_entity.h |
---|
[2190] | 3 | \brief Definition of the basic WorldEntity |
---|
| 4 | */ |
---|
[2036] | 5 | |
---|
[3224] | 6 | #ifndef _WORLD_ENTITY_H |
---|
| 7 | #define _WORLD_ENTITY_H |
---|
[2036] | 8 | |
---|
[3365] | 9 | #include "p_node.h" |
---|
[3746] | 10 | #include "comincl.h" |
---|
| 11 | #include "resource_manager.h" |
---|
[2036] | 12 | |
---|
[3746] | 13 | |
---|
[3474] | 14 | //class CollisionCluster; |
---|
[3605] | 15 | class CharacterAttributes; |
---|
[3746] | 16 | class Model; |
---|
[2036] | 17 | |
---|
[3605] | 18 | |
---|
[2190] | 19 | //! Basic class from which all interactive stuff in the world is derived from |
---|
[3365] | 20 | class WorldEntity : public PNode |
---|
[2190] | 21 | { |
---|
[2551] | 22 | friend class World; |
---|
[3365] | 23 | |
---|
[2036] | 24 | public: |
---|
[2190] | 25 | WorldEntity (bool isFree = false); |
---|
[3221] | 26 | virtual ~WorldEntity (); |
---|
[3365] | 27 | |
---|
[3605] | 28 | |
---|
| 29 | |
---|
[2551] | 30 | |
---|
[3474] | 31 | //void setCollision (CollisionCluster* newhull); |
---|
[2551] | 32 | |
---|
[2190] | 33 | //void addAbility(Ability* ability); |
---|
| 34 | //void removeAbility(Ability* ability); |
---|
[3605] | 35 | void setDrawable (bool bDraw); |
---|
| 36 | bool isFree (); |
---|
| 37 | void setCharacterAttributes(CharacterAttributes* charAttr); |
---|
| 38 | CharacterAttributes* getCharacterAttributes(); |
---|
| 39 | |
---|
[3229] | 40 | virtual void postSpawn (); |
---|
[3605] | 41 | virtual void leftWorld (); |
---|
| 42 | |
---|
| 43 | virtual void hit (WorldEntity* weapon, Vector* loc); |
---|
[2190] | 44 | virtual void collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags); |
---|
[2551] | 45 | virtual void command (Command* cmd); |
---|
[3365] | 46 | |
---|
| 47 | void processDraw (); |
---|
[2190] | 48 | virtual void draw (); |
---|
[3605] | 49 | virtual void tick (float time); |
---|
[2551] | 50 | |
---|
[3605] | 51 | protected: |
---|
[3746] | 52 | Model* model; //!< The model that should be loaded for this entity. |
---|
[3605] | 53 | CharacterAttributes* charAttr; //!< the character attributes of a world_entity |
---|
[2551] | 54 | |
---|
[2036] | 55 | private: |
---|
[3449] | 56 | const bool bFree; //!< If the entity is free. |
---|
| 57 | bool bCollide; //!< If it should be considered for the collisiontest. |
---|
| 58 | bool bDraw; //!< If it should be visible. |
---|
[3365] | 59 | |
---|
[3605] | 60 | |
---|
| 61 | |
---|
[3474] | 62 | //CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity. |
---|
[2036] | 63 | }; |
---|
| 64 | |
---|
[3224] | 65 | #endif /* _WORLD_ENTITY_H */ |
---|