diff options
Diffstat (limited to '')
-rwxr-xr-x | include/game.h | 37 |
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;
|