State
// These macros define a state mechanism in any class that receives OnForward() and/or OnReverse() updates.
// This enables a class to use SetFwdState()/SetRevState() to redirect the update callbacks to any class member
// functions as needed to alter logic (state) of the object.
// Put this last in the OnForward() callback.
#define RVFWDSTATE if (fwdState) (*this.*fwdState)();
// Put this last in the OnReverse() callback.
#define RVREVSTATE if (revState) (*this.*revState)();
// Put this in the private section of the class and set [_CLASS_] to the class name. This defines SetFwdState()
// /SetRevState() functions that can set a member function to begin receiving updates. The syntax for passing
// a member function to the call is: SetFwdState(&MyClass::MyFunction).
#define RVSTATEFUNCS(_CLASS_) \
typedef void (_CLASS_:: *FState)();\
FState fwdState = 0, revState = 0;\
void SetFwdState(FState func) { fwdState = func; }\
void SetRevState(FState func) { revState = func; }