Line | |
---|
1 | /* |
---|
2 | * file groundTurret.h |
---|
3 | * A weapon that is fix located, and automatically shooting at a target. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _ADM_TURRET_H |
---|
7 | #define _ADM_TURRET_H |
---|
8 | |
---|
9 | //#include "sound_buffer.h" |
---|
10 | //#include "sound_source.h" |
---|
11 | |
---|
12 | #include "world_entity.h" |
---|
13 | |
---|
14 | class AdmTurret : public WorldEntity |
---|
15 | { |
---|
16 | ObjectListDeclaration(AdmTurret); |
---|
17 | public: |
---|
18 | AdmTurret (); |
---|
19 | AdmTurret (const TiXmlElement* root); |
---|
20 | virtual ~AdmTurret(); |
---|
21 | |
---|
22 | void init(); |
---|
23 | void loadParams(const TiXmlElement* root); |
---|
24 | |
---|
25 | virtual void tick(float dt); |
---|
26 | virtual void draw() const; |
---|
27 | virtual void collidesWith(WorldEntity* entity, const Vector& location); |
---|
28 | |
---|
29 | virtual void activate(); |
---|
30 | virtual void deactivate(); |
---|
31 | |
---|
32 | virtual void setTarget(const std::string& target); |
---|
33 | |
---|
34 | private: |
---|
35 | WorldEntity* cannons; |
---|
36 | WorldEntity* sensor; |
---|
37 | WorldEntity* myTarget; |
---|
38 | bool isVisible(const WorldEntity myTarget); |
---|
39 | float aim(const WorldEntity Target); |
---|
40 | void fire(); |
---|
41 | |
---|
42 | void addCannons(const TiXmlElement* root); |
---|
43 | void addSensor(const TiXmlElement* root); |
---|
44 | |
---|
45 | void moveTowards( Vector targetDir, float dt ); |
---|
46 | |
---|
47 | }; |
---|
48 | |
---|
49 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.