summaryrefslogtreecommitdiff
path: root/include/game.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-01-08 17:32:49 +0100
committerTreeki <treeki@gmail.com>2012-01-08 17:32:49 +0100
commitac69cf874d619722b1d93526702ea81aa24c7e48 (patch)
treec1f763edb12f1cfbcf30f8ae312275b16c4ced03 /include/game.h
parent14fc0d0f71e1cb682473b7f7bbc959cfa70d163d (diff)
downloadkamek-ac69cf874d619722b1d93526702ea81aa24c7e48.tar.gz
kamek-ac69cf874d619722b1d93526702ea81aa24c7e48.zip
states fixed, now compiles
Diffstat (limited to '')
-rwxr-xr-xinclude/game.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/include/game.h b/include/game.h
index 3b2876d..e5a4813 100755
--- a/include/game.h
+++ b/include/game.h
@@ -1095,6 +1095,12 @@ class dActorMultiState_c;
template <class TOwner>
class dStateWrapperBase_c {
public:
+ dStateWrapperBase_c() :
+ manager(&pointless, &executor, &dStateBase_c::mNoState) { }
+
+ dStateWrapperBase_c(dState_c<TOwner> *pInitState) :
+ manager(&pointless, &executor, pInitState) { }
+
virtual ~dStateWrapperBase_c() { }
dStatePointless_c pointless;
@@ -1102,21 +1108,27 @@ public:
dStateMgr_c manager;
- // All these are passed straight through to the manager, todo: name them and arguments
- virtual void ensureStateHasBegun();
- virtual void execute();
- virtual void endCurrentState();
- virtual void setState(dStateBase_c *pNewState);
- virtual void executeNextStateThisTick();
- virtual dStateMethodExecutorBase_c *getCurrentStateMethodExecutor();
- virtual dStateBase_c *getNextState();
- virtual dStateBase_c *getCurrentState();
- virtual dStateBase_c *getPreviousState();
+ // All these are passed straight through to the manager
+ virtual void ensureStateHasBegun() { manager.ensureStateHasBegun(); }
+ virtual void execute() { manager.execute(); }
+ virtual void endCurrentState() { manager.endCurrentState(); }
+ virtual void setState(dStateBase_c *pNewState) { manager.setState(pNewState); }
+ virtual void executeNextStateThisTick() { manager.executeNextStateThisTick(); }
+ virtual dStateMethodExecutorBase_c *getCurrentStateMethodExecutor() { return manager.getCurrentStateMethodExecutor(); }
+ virtual dStateBase_c *getNextState() { return manager.getNextState(); }
+ virtual dStateBase_c *getCurrentState() { return manager.getCurrentState(); }
+ virtual dStateBase_c *getPreviousState() { return manager.getPreviousState(); }
};
template <class TOwner>
class dStateWrapper_c : public dStateWrapperBase_c<TOwner> {
public:
+ dStateWrapper_c() :
+ dStateWrapperBase_c() { }
+
+ dStateWrapper_c(dState_c<TOwner> *pInitState) :
+ dStateWrapperBase_c(pInitState) { }
+
~dStateWrapper_c() { }
};
@@ -1164,6 +1176,11 @@ public:
&CLASS::executeState_##NAME, \
&CLASS::endState_##NAME);
+#define CREATE_STATE_E(CLASS, NAME) \
+ CREATE_STATE(CLASS, NAME) \
+ void CLASS::beginState_##NAME() { } \
+ void CLASS::endState_##NAME() { }
+
#define USING_STATES(CLASS) \
typedef dState_c<CLASS> State;