Line | |
---|
1 | |
---|
2 | #ifndef _AI_MODULE_H |
---|
3 | #define _AI_MODULE_H |
---|
4 | #include "world_entity.h" |
---|
5 | class NPC2; |
---|
6 | |
---|
7 | class AIModule { |
---|
8 | public: |
---|
9 | inline AIModule(){taskComplete=false;} |
---|
10 | virtual ~AIModule(){} |
---|
11 | virtual void process(float dt){} |
---|
12 | |
---|
13 | inline void setDestination(Vector destination){this->destination=destination;} |
---|
14 | inline void setDestinationMovement(Vector destinationMovement){this->destinationMovement=destinationMovement;} |
---|
15 | inline void setWeight(int weight){this->weight=weight;} |
---|
16 | inline void setTarget(WorldEntity* target){this->target=target;} |
---|
17 | inline void setNPC(WorldEntity* npc){this->npc=npc;} |
---|
18 | |
---|
19 | inline Vector getPosition(){return npc->getAbsCoor();} |
---|
20 | inline Vector getMovement(){return movement;} |
---|
21 | inline Vector getView(){return view;} |
---|
22 | inline WorldEntity* getNPC(){return npc;} |
---|
23 | inline WorldEntity* getTarget(){return target;} |
---|
24 | inline float getWeight(){return weight;} |
---|
25 | inline float getMaxAcceleration(){return accelerationMax;} |
---|
26 | inline float getMaxSpeed(){return speedMax;} |
---|
27 | inline float getNPCRadius(){return getRadius(npc);} |
---|
28 | |
---|
29 | inline bool done(){return taskComplete;} |
---|
30 | |
---|
31 | void getAttributesFrom(AIModule* oldModule); |
---|
32 | |
---|
33 | protected: |
---|
34 | float getRadius(WorldEntity* object); |
---|
35 | |
---|
36 | Vector destination; |
---|
37 | Vector destinationMovement; |
---|
38 | Vector destinationView; |
---|
39 | |
---|
40 | bool taskComplete; |
---|
41 | Vector movement; |
---|
42 | Vector view; |
---|
43 | |
---|
44 | WorldEntity* npc; |
---|
45 | WorldEntity* target; |
---|
46 | |
---|
47 | float weight; |
---|
48 | float speedMax; |
---|
49 | float accelerationMax; |
---|
50 | }; |
---|
51 | |
---|
52 | #endif /* _AI_MODULE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.