-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a solution that seemingly works
- Loading branch information
1 parent
1a91a6d
commit b2fdfb0
Showing
9 changed files
with
126 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef S_FSTATE_VIRTUAL_ID_H | ||
#define S_FSTATE_VIRTUAL_ID_H | ||
|
||
#include "s/s_FStateID.hpp" | ||
#include "s/s_StateID.hpp" | ||
|
||
template <typename T> | ||
class sFStateVirtualID_c : public sFStateID_c<T> { | ||
public: | ||
typedef void (T::*stateFunc)(); | ||
sFStateVirtualID_c( | ||
const sStateID_c *superState, const char *name, stateFunc initialize, stateFunc execute, stateFunc finalize | ||
) | ||
: sFStateID_c<T>(name, initialize, execute, finalize), mpSuperState(superState) {} | ||
|
||
virtual unsigned int number() const { | ||
return superID()->numberBase(); | ||
} | ||
|
||
const sFStateVirtualID_c<T> *superID() const { | ||
if (!mpSuperState->isNull()) { | ||
return static_cast<const sFStateVirtualID_c<T> *>(mpSuperState)->superID(); | ||
} | ||
return this; | ||
} | ||
|
||
unsigned int numberBase() const { | ||
return sStateID_c::number(); | ||
} | ||
|
||
private: | ||
const sStateID_c *mpSuperState; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters