summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-09-17 03:20:02 +0200
committerTreeki <treeki@gmail.com>2011-09-17 03:20:02 +0200
commit5a9232c600b333b325eb14cc91ba1bba1e369283 (patch)
treec96616d1f46d0dfda586d576e2df367db80bde0d /src
parent75f7a14b0daf22b74a4f6fd55e35b0a407ecf0ba (diff)
downloadkamek-5a9232c600b333b325eb14cc91ba1bba1e369283.tar.gz
kamek-5a9232c600b333b325eb14cc91ba1bba1e369283.zip
new fancy preprocessor stuff for States
Diffstat (limited to 'src')
-rw-r--r--src/eventblock.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/eventblock.cpp b/src/eventblock.cpp
index f285da8..6f353b7 100644
--- a/src/eventblock.cpp
+++ b/src/eventblock.cpp
@@ -10,8 +10,6 @@ public:
SWAP_EVENTS = 1
};
- typedef State<daEnEventBlock_c> State;
-
TileRenderer tile;
Physics::Info physicsInfo;
@@ -28,21 +26,16 @@ public:
void calledWhenUpMoveExecutes();
void calledWhenDownMoveExecutes();
- void wait_Begin();
- void wait_Execute();
- void wait_End();
-
void blockWasHit(bool isDown);
- static State StateID_Wait;
+ USING_STATES(daEnEventBlock_c);
+ DECLARE_STATE(Wait);
+
static daEnEventBlock_c *build();
};
-daEnEventBlock_c::State daEnEventBlock_c::StateID_Wait(
- "daEnEventBlock_c::StateID_Wait",
- &daEnEventBlock_c::wait_Begin,
- &daEnEventBlock_c::wait_Execute,
- &daEnEventBlock_c::wait_End);
+
+CREATE_STATE(daEnEventBlock_c, Wait);
int daEnEventBlock_c::onCreate() {
@@ -184,13 +177,13 @@ void daEnEventBlock_c::calledWhenDownMoveExecutes() {
-void daEnEventBlock_c::wait_Begin() {
+void daEnEventBlock_c::beginState_Wait() {
}
-void daEnEventBlock_c::wait_End() {
+void daEnEventBlock_c::endState_Wait() {
}
-void daEnEventBlock_c::wait_Execute() {
+void daEnEventBlock_c::executeState_Wait() {
int result = blockResult();
if (result == 0)