Skip to content

Instantly share code, notes, and snippets.

@Nub
Created June 27, 2011 22:09
Show Gist options
  • Save Nub/1049977 to your computer and use it in GitHub Desktop.
Save Nub/1049977 to your computer and use it in GitHub Desktop.
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