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