My Project: openb3dlib.mod/openb3d/src/actions.h Source File

My Project

actions.h
Go to the documentation of this file.
1 #ifndef ACTIONS_H
2 #define ACTIONS_H
3
4 #include "entity.h"
5
6 enum{ACT_COMPLETED,
7 ACT_MOVEBY,
8 ACT_TURNBY,
9 ACT_VECTOR,
10 ACT_MOVETO,
11 ACT_TURNTO,
12 ACT_SCALETO,
13 ACT_FADETO,
14 ACT_TINTTO,
15 ACT_TRACK_BY_POINT,
16 ACT_TRACK_BY_DISTANCE,
17 ACT_NEWTONIAN
18 };
19
20 class Action{
21
22 public:
23 static list<Action*> action_list;
24
25 int act;
26
27 Entity* ent;
28 Entity* target; //Optional, target entity for some actions
29
30 float rate;
31 float a,b,c;
32
33 list<Action*> nextActions;
34
35 static Action* AddAction(Entity* ent, int action, Entity* t, float a, float b, float c, float rate);
36 static Action* AddAction(Entity* ent, int action, float a, float b, float c, float rate){
37 return AddAction(ent, action, 0, a, b, c, rate);
38 };
39 static Action* AddAction(Entity* ent, int action, Entity* t, float rate){
40 return AddAction(ent, action, t, 0, 0, 0, rate);
41 };
42 void AppendAction (Action* a);
43 void FreeAction ();
44 static void Update();
45 };
46
47
48
49 #endif
ACT_COMPLETED
Definition: actions.h:6
entity.h
Action::ent
Entity * ent
Definition: actions.h:27
ACT_TRACK_BY_POINT
Definition: actions.h:15
ACT_MOVEBY
Definition: actions.h:7
ACT_VECTOR
Definition: actions.h:9
Action::AppendAction
void AppendAction(Action *a)
Definition: actions.cpp:220
Action::b
float b
Definition: actions.h:31
Action::AddAction
static Action * AddAction(Entity *ent, int action, float a, float b, float c, float rate)
Definition: actions.h:36
Action::Update
static void Update()
Definition: actions.cpp:6
ACT_SCALETO
Definition: actions.h:12
Action::AddAction
static Action * AddAction(Entity *ent, int action, Entity *t, float a, float b, float c, float rate)
Definition: actions.cpp:205
ACT_TURNTO
Definition: actions.h:11
Action::AddAction
static Action * AddAction(Entity *ent, int action, Entity *t, float rate)
Definition: actions.h:39
Action
Definition: actions.h:20
Action::FreeAction
void FreeAction()
Definition: actions.cpp:225
ACT_FADETO
Definition: actions.h:13
Entity
Definition: entity.h:27
ACT_MOVETO
Definition: actions.h:10
Action::rate
float rate
Definition: actions.h:30
Action::action_list
static list< Action * > action_list
Definition: actions.h:23
Action::nextActions
list< Action * > nextActions
Definition: actions.h:33
Action::a
float a
Definition: actions.h:31
Action::act
int act
Definition: actions.h:25
ACT_TRACK_BY_DISTANCE
Definition: actions.h:16
Action::c
float c
Definition: actions.h:31
Action::target
Entity * target
Definition: actions.h:28
ACT_TURNBY
Definition: actions.h:8
ACT_NEWTONIAN
Definition: actions.h:17
ACT_TINTTO
Definition: actions.h:14