From 5a9232c600b333b325eb14cc91ba1bba1e369283 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 17 Sep 2011 03:20:02 +0200 Subject: new fancy preprocessor stuff for States --- src/eventblock.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src') 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 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) -- cgit v1.2.3