diff options
author | Treeki <treeki@gmail.com> | 2011-09-17 03:20:02 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-09-17 03:20:02 +0200 |
commit | 5a9232c600b333b325eb14cc91ba1bba1e369283 (patch) | |
tree | c96616d1f46d0dfda586d576e2df367db80bde0d /include/game.h | |
parent | 75f7a14b0daf22b74a4f6fd55e35b0a407ecf0ba (diff) | |
download | kamek-5a9232c600b333b325eb14cc91ba1bba1e369283.tar.gz kamek-5a9232c600b333b325eb14cc91ba1bba1e369283.zip |
new fancy preprocessor stuff for States
Diffstat (limited to 'include/game.h')
-rwxr-xr-x | include/game.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/game.h b/include/game.h index 3476eaa..7382c34 100755 --- a/include/game.h +++ b/include/game.h @@ -1104,6 +1104,23 @@ public: };
+#define DECLARE_STATE(NAME) \
+ static State StateID_##NAME; \
+ void beginState_##NAME(); \
+ void executeState_##NAME(); \
+ void endState_##NAME();
+
+#define CREATE_STATE(CLASS, NAME) \
+ CLASS::State CLASS::StateID_##NAME \
+ (#CLASS "::StateID_" #NAME, \
+ &CLASS::beginState_##NAME, \
+ &CLASS::executeState_##NAME, \
+ &CLASS::endState_##NAME);
+
+#define USING_STATES(CLASS) \
+ typedef State<CLASS> State;
+
+
struct LinkListEntry {
LinkListEntry *prev;
LinkListEntry *next;
|