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