Created
June 27, 2011 22:09
-
-
Save Nub/1049977 to your computer and use it in GitHub Desktop.
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
class TimerCallback | |
{ | |
public: | |
virtual ~TimerCallback() {} | |
virtual void callback() = 0; | |
}; | |
class Timer | |
{ | |
private: | |
vector<TimerCallback>;//stack of callbacks | |
public: | |
init();//etc... | |
update();//go through and call the callback when needed | |
}; | |
class Child : public TimerCallback | |
{ | |
public: | |
virtual void callback() | |
{ | |
//do stuff | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment