aboutsummaryrefslogtreecommitdiff
path: root/advtrains_train_japan
ModeNameSize
-rw-r--r--depends.txt41logplain
-rw-r--r--init.lua3244logplain
d---------locale34logplain
d---------models107logplain
d---------sounds52logplain
d---------textures222logplain
t">~MtEvent() = default; //virtual MtEvent* clone(){ return new IEvent; } virtual const char* getType() const = 0; MtEvent* checkIs(const std::string &type) { if(type == getType()) return this; return NULL; } }; // An event with no parameters and customizable name class SimpleTriggerEvent: public MtEvent { const char *type; public: SimpleTriggerEvent(const char *type): type(type) {} const char* getType() const {return type;} }; class MtEventReceiver { public: virtual ~MtEventReceiver() = default; virtual void onEvent(MtEvent *e) = 0; }; typedef void (*event_receive_func)(MtEvent *e, void *data); class MtEventManager { public: virtual ~MtEventManager() = default; virtual void put(MtEvent *e) = 0; virtual void reg(const char *type, event_receive_func f, void *data) = 0; // If data==NULL, every occurence of f is deregistered. virtual void dereg(const char *type, event_receive_func f, void *data) = 0; virtual void reg(MtEventReceiver *r, const char *type) = 0; virtual void dereg(MtEventReceiver *r, const char *type) = 0; };