1 /* -*- Mode: C++ -*- */
6 #include <wvcallback.h>
7 #include <wvlinklist.h>
9 #include <wvtimestream.h>
32 // int parameter is the id of whatever we're talking about in the callback:
33 // ship, player, planet, etc.
34 typedef WvCallback
<void, int> TWCEventCallback
;
46 DeclareWvList(TWCEvent
);
48 int event_sorter(const TWCEvent
*a
, const TWCEvent
*b
);
50 class TWCEventHandler
: public WvTimeStream
55 // use set_timer() to start the handler.
57 virtual ~TWCEventHandler();
59 // Returns index of event.
60 int add_event(TWCEventCallback _cb
, int _id
, time_t _interval
,
63 // Remove event by index.
64 void remove_event(int event_idx
);
66 virtual void execute();
69 #endif // __TWCEVENT_H