Line | |
---|
1 | |
---|
2 | #ifndef _NPC_H |
---|
3 | #define _NPC_H |
---|
4 | |
---|
5 | #include "world_entity.h" |
---|
6 | #include "ai_module.h" |
---|
7 | #include "world_entities/weapons/weapon_manager.h" |
---|
8 | |
---|
9 | class AI; |
---|
10 | |
---|
11 | class NPC : public WorldEntity |
---|
12 | { |
---|
13 | ObjectListDeclaration(NPC); |
---|
14 | |
---|
15 | public: |
---|
16 | NPC(const TiXmlElement* root = NULL); |
---|
17 | virtual ~NPC (); |
---|
18 | |
---|
19 | virtual void loadParams(const TiXmlElement* root); |
---|
20 | |
---|
21 | |
---|
22 | void addWeapons(const TiXmlElement* root); |
---|
23 | bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); |
---|
24 | void removeWeapon(Weapon* weapon); |
---|
25 | void nextWeaponConfig(); |
---|
26 | void previousWeaponConfig(); |
---|
27 | inline WeaponManager& getWeaponManager() { return this->weaponMan; }; |
---|
28 | |
---|
29 | |
---|
30 | virtual void tick(float dt); |
---|
31 | inline int getTeam() { return teamNumber; } |
---|
32 | inline void fire(){ this->bFire=true;} |
---|
33 | |
---|
34 | inline void enableAI() { this->bAIEnabled = true; } |
---|
35 | |
---|
36 | private: |
---|
37 | inline void setTeamNumber(int number) { teamNumber=number; } |
---|
38 | inline void setSwarmNumber(int number) { swarmNumber=number; } |
---|
39 | inline void setMaxSpeed(float number) { maxSpeed=number; } |
---|
40 | inline void setAttackDistance(float number) { attackDistance=number; } |
---|
41 | |
---|
42 | private: |
---|
43 | |
---|
44 | int teamNumber; //!< number of the team |
---|
45 | int swarmNumber; //!< number of the swarm |
---|
46 | int difficulty; //!< difficulty |
---|
47 | float maxSpeed; |
---|
48 | float attackDistance; |
---|
49 | |
---|
50 | WeaponManager weaponMan; //!< weapon manager |
---|
51 | bool bFire; //!< fire |
---|
52 | |
---|
53 | AIModule* aiModule; |
---|
54 | |
---|
55 | bool bAIEnabled; //!< true is AI enabled |
---|
56 | }; |
---|
57 | |
---|
58 | #endif /* _NPC_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.