|
Adonthell
0.4
|
Baseclass for map enter/leave/action events. More...
#include <map_event.h>


Public Member Functions | |
| map_event () | |
| Default constructor. More... | |
| void | put_state (ogzstream &) const |
| Saves the basic event data (such as the type or script data) to a file. More... | |
| bool | get_state (igzstream &) |
| Loads the basic event date from a file. More... | |
| bool | equals (const event *evnt) |
| Compare two map events for equality. More... | |
| s_int32 | execute (const event *evnt) |
| Executes the script associated with this map event. More... | |
Public Member Functions inherited from event | |
| event () | |
| Constructor. More... | |
| virtual | ~event () |
| Destructor. More... | |
| void | clear () |
| Cleanup. More... | |
| u_int8 | type () const |
| Get the event's type. More... | |
| const string & | id () const |
| Get the event's id. More... | |
| 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 pointer to it. More... | |
| bool | registered () const |
| Test whether the event is registered with the event handler. More... | |
| void | set_registered (bool reg) |
| Set whether the event is registered with the event handler. More... | |
| void | set_list (event_list *list) |
| Tell the whether it is kept in an event_list. More... | |
| s_int32 | repeat () const |
| Return whether this event should be repeated. More... | |
| void | set_repeat (s_int32 count) |
| Set whether this event should be repeated. More... | |
| void | set_script (string filename, PyObject *args=NULL) |
| Sets a script to be executed whenever the event occurs. More... | |
| void | set_callback (PyObject *callback, PyObject *args=NULL) |
| Sets a python function/method to be executed whenever the event occurs. More... | |
| void | set_callback (const Functor0 &callback) |
| Sets a C function/C++ method to be executed whenever the event occurs. More... | |
| virtual void | pause () |
| Disable the event temporarily. More... | |
| virtual void | resume () |
| Re-enable an event that has been paused. More... | |
| bool | is_paused () const |
| Check whether the event is temporarily disabled or not. More... | |
Public Attributes | |
| s_int32 | submap |
| Submap index (-1 for any). More... | |
| s_int32 | x |
| X position (-1 for any). More... | |
| s_int32 | y |
| Y position (-1 for any). More... | |
| s_int8 | dir |
| Direction where the character is looking (-1 for any). More... | |
| s_int32 | map |
| Useless (for now). More... | |
| mapcharacter * | c |
| Pointer to the mapcharacter that can launch this event (NULL for any). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from event | |
| s_int32 | do_repeat () |
| Decrease the event's repeat count and return the number of repeats left. More... | |
Protected Attributes inherited from event | |
| u_int8 | Type |
| Event type - see enum above. More... | |
| string | Id |
| (Optional) Id of the event More... | |
| u_int8 | Action |
| What happens if the event occurs - see enum above. More... | |
| bool | Registered |
| Whether the event is registered with the event handler. More... | |
| bool | Paused |
| Whether the event temporarily disabled or not. More... | |
| s_int32 | Repeat |
| Defines how often the event should be repeated. More... | |
| py_object * | Script |
| The Python script accociated with this event. More... | |
| PyObject * | Args |
| The arguments passed to the script. More... | |
| py_callback * | PyFunc |
| Python callback that may be executed instead of the script. More... | |
| Functor0 | Callback |
| C++ callback that may be executed when the event gets triggered. More... | |
| event_list * | List |
| The event_list this event is kept in. More... | |
Baseclass for map enter/leave/action events.
The event will be launched if all the member's data matches.
Definition at line 36 of file map_event.h.
| map_event::map_event | ( | ) |
Default constructor.
Definition at line 29 of file map_event.cc.
|
virtual |
Saves the basic event data (such as the type or script data) to a file.
| out | file where to save the event. |
Reimplemented from event.
Definition at line 110 of file map_event.cc.
|
virtual |
Loads the basic event date from a file.
| in | file to load the event from. |
Reimplemented from event.
Definition at line 88 of file map_event.cc.
|
virtual |
Compare two map events for equality.
| evnt | The map event to compare this to. |
Implements event.
Definition at line 36 of file map_event.cc.
Executes the script associated with this map event.
If the event does not repeat it is removed from the event handler.
| evnt | The event that triggered this map event. |
Implements event.
Definition at line 52 of file map_event.cc.
| s_int32 map_event::submap |
Submap index (-1 for any).
Definition at line 63 of file map_event.h.
| s_int32 map_event::x |
X position (-1 for any).
Definition at line 68 of file map_event.h.
| s_int32 map_event::y |
Y position (-1 for any).
Definition at line 73 of file map_event.h.
| s_int8 map_event::dir |
Direction where the character is looking (-1 for any).
Definition at line 78 of file map_event.h.
| s_int32 map_event::map |
Useless (for now).
Definition at line 83 of file map_event.h.
| mapcharacter* map_event::c |
Pointer to the mapcharacter that can launch this event (NULL for any).
Definition at line 88 of file map_event.h.