MCPcopy Create free account
hub / github.com/DFHack/dfhack / EventHandler

Class EventHandler

library/include/modules/EventManager.h:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 struct EventHandler {
44 Plugin* plugin;
45 typedef void (*callback_t)(color_ostream&, void*); //called when the event happens
46 callback_t eventHandler;
47 int32_t freq; //how often event is allowed to fire (in ticks) use 0 to always fire when possible
48
49 EventHandler(Plugin* pluginIn, callback_t eventHandlerIn, int32_t freqIn)
50 : plugin(pluginIn), eventHandler(eventHandlerIn), freq(freqIn)
51 { }
52
53 bool operator==(const EventHandler& handle) const {
54 return plugin == handle.plugin && eventHandler == handle.eventHandler && freq == handle.freq;
55 }
56 bool operator!=(const EventHandler& handle) const {
57 return !( *this == handle);
58 }
59 };
60
61 struct SyndromeData {
62 int32_t unitId;

Callers 3

do_enableFunction · 0.85
enableEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected