Go to the documentation of this file.
39 #define EVENTS_DIR "game_events."
112 const string &
id ()
const
209 void set_script (
string filename, PyObject * args = NULL);
221 void set_callback (PyObject *callback, PyObject *args = NULL);
248 virtual void pause ();
string Id
(Optional) Id of the event
virtual bool equals(const event *evnt)=0
Compare two events for equality.
u_int8 type() const
Get the event's type.
event_list * List
The event_list this event is kept in.
virtual void put_state(ogzstream &out) const
Saves the basic event data (such as the type or script data) to a file.
Class to read data from a Gzip compressed file.
PyObject * Args
The arguments passed to the script.
Base class for objects that want to register events.
s_int32 Repeat
Defines how often the event should be repeated.
#define s_int32
32 bits long signed integer
void set_callback(PyObject *callback, PyObject *args=NULL)
Sets a python function/method to be executed whenever the event occurs.
u_int8 Action
What happens if the event occurs - see enum above.
Declares the py_object class.
void set_script(string filename, PyObject *args=NULL)
Sets a script to be executed whenever the event occurs.
Class to write data from a Gzip compressed file.
bool Registered
Whether the event is registered with the event handler.
#define u_int8
8 bits long unsigned integer
virtual ~event()
Destructor.
bool Paused
Whether the event temporarily disabled or not.
virtual void pause()
Disable the event temporarily.
void set_repeat(s_int32 count)
Set whether this event should be repeated.
virtual bool get_state(igzstream &in)
Loads the basic event date from a file.
py_callback * PyFunc
Python callback that may be executed instead of the script.
virtual s_int32 execute(const event *evnt)=0
Execute the associated python script or callback.
virtual void resume()
Re-enable an event that has been paused.
void set_list(event_list *list)
Tell the whether it is kept in an event_list.
s_int32 repeat() const
Return whether this event should be repeated.
u_int8 Type
Event type - see enum above.
s_int32 do_repeat()
Decrease the event's repeat count and return the number of repeats left.
void set_registered(bool reg)
Set whether the event is registered with the event handler.
py_object * Script
The Python script accociated with this event.
bool registered() const
Test whether the event is registered with the event handler.
Functor0 Callback
C++ callback that may be executed when the event gets triggered.
bool is_paused() const
Check whether the event is temporarily disabled or not.
const string & id() const
Get the event's id.
void set_id(const string &id)
Assign an id to the event, so it may be retrieved from an event_list later on, without having a point...
Stores the C++ <-> Python callback binding.
Declares the py_callback class.