|
Atrinik Server 2.5
|
#include <plugin_python.h>Go to the source code of this file.
Defines | |
| #define | NUM_MAPFLAGS (sizeof(mapflag_names) / sizeof(mapflag_names[0])) |
Functions | |
| static PyObject * | Atrinik_Map_GetFirstObject (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_GetLastObject (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_GetLayer (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_GetMapFromCoord (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_PlaySound (Atrinik_Map *map, PyObject *args, PyObject *keywds) |
| static PyObject * | Atrinik_Map_Message (Atrinik_Map *map, PyObject *args, PyObject *keywds) |
| static PyObject * | Atrinik_Map_CreateObject (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_CountPlayers (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_GetPlayers (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_Insert (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_Wall (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_Blocked (Atrinik_Map *map, PyObject *args) |
| static PyObject * | Atrinik_Map_FreeSpot (Atrinik_Map *map, PyObject *args) |
| static PyObject * | get_attribute (Atrinik_Map *map, void *context) |
| static int | set_attribute (Atrinik_Map *map, PyObject *value, void *context) |
| static PyObject * | Map_GetFlag (Atrinik_Map *map, void *context) |
| static int | Map_SetFlag (Atrinik_Map *map, PyObject *val, void *context) |
| static PyObject * | Atrinik_Map_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
| static void | Atrinik_Map_dealloc (Atrinik_Map *self) |
| static PyObject * | Atrinik_Map_str (Atrinik_Map *self) |
| static int | Atrinik_Map_InternalCompare (Atrinik_Map *left, Atrinik_Map *right) |
| static PyObject * | Atrinik_Map_RichCompare (Atrinik_Map *left, Atrinik_Map *right, int op) |
| int | Atrinik_Map_init (PyObject *module) |
| PyObject * | wrap_map (mapstruct *what) |
Variables | |
| static fields_struct | fields [] |
| static char * | mapflag_names [] |
| static PyMethodDef | MapMethods [] |
| static PyGetSetDef | getseters [NUM_FIELDS+NUM_MAPFLAGS+1] |
| PyTypeObject | Atrinik_MapType |
Atrinik Python plugin map related code.
Definition in file atrinik_map.c.
| #define NUM_MAPFLAGS (sizeof(mapflag_names) / sizeof(mapflag_names[0])) |
Number of map flags
Definition at line 78 of file atrinik_map.c.
| static void Atrinik_Map_dealloc | ( | Atrinik_Map * | self | ) | [static] |
Free a map wrapper.
| self | The wrapper to free. |
Definition at line 611 of file atrinik_map.c.
| int Atrinik_Map_init | ( | PyObject * | module | ) |
Initialize the map wrapper.
| module | The Atrinik Python module. |
Definition at line 694 of file atrinik_map.c.
| static PyObject* Atrinik_Map_new | ( | PyTypeObject * | type, |
| PyObject * | args, | ||
| PyObject * | kwds | ||
| ) | [static] |
Create a new map wrapper.
| type | Type object. |
| args | Unused. |
| kwds | Unused. |
Definition at line 591 of file atrinik_map.c.
| static PyObject* Atrinik_Map_str | ( | Atrinik_Map * | self | ) | [static] |
Return a string representation of a map.
| self | The map type. |
Definition at line 625 of file atrinik_map.c.
| static PyObject* get_attribute | ( | Atrinik_Map * | map, |
| void * | context | ||
| ) | [static] |
Get map's attribute.
| map | Python map wrapper. |
| context | Void pointer to the field. |
Definition at line 504 of file atrinik_map.c.
| static PyObject* Map_GetFlag | ( | Atrinik_Map * | map, |
| void * | context | ||
| ) | [static] |
Get map's flag.
| map | Python map wrapper. |
| context | Void pointer to the flag ID. |
| Py_True | The map has the flag set. |
| Py_False | The map doesn't have the flag set. |
| NULL | An error occurred. |
Definition at line 537 of file atrinik_map.c.
| static int Map_SetFlag | ( | Atrinik_Map * | map, |
| PyObject * | val, | ||
| void * | context | ||
| ) | [static] |
Set map's flag.
| map | Python map wrapper. |
| val | Value to set. Should be either Py_True or Py_False. |
| context | Void pointer to the flag ID. |
Definition at line 557 of file atrinik_map.c.
| static int set_attribute | ( | Atrinik_Map * | map, |
| PyObject * | value, | ||
| void * | context | ||
| ) | [static] |
Set attribute of a map.
| map | Python map wrapper. |
| value | Value to set. |
| context | Void pointer to the field. |
Definition at line 515 of file atrinik_map.c.
| PyObject* wrap_map | ( | mapstruct * | what | ) |
Utility method to wrap a map.
| what | Map to wrap. |
Definition at line 741 of file atrinik_map.c.
| PyTypeObject Atrinik_MapType |
Our actual Python MapType.
Definition at line 653 of file atrinik_map.c.
fields_struct fields[] [static] |
{
{"next", FIELDTYPE_MAP, offsetof(mapstruct, next), FIELDFLAG_READONLY, 0},
{"previous", FIELDTYPE_MAP, offsetof(mapstruct, previous), FIELDFLAG_READONLY, 0},
{"name", FIELDTYPE_CSTR, offsetof(mapstruct, name), 0, 0},
{"msg", FIELDTYPE_CSTR, offsetof(mapstruct, msg), 0, 0},
{"reset_timeout", FIELDTYPE_UINT32, offsetof(mapstruct, reset_timeout), 0, 0},
{"timeout", FIELDTYPE_SINT32, offsetof(mapstruct, timeout), 0, 0},
{"difficulty", FIELDTYPE_UINT16, offsetof(mapstruct, difficulty), 0, 0},
{"height", FIELDTYPE_UINT16, offsetof(mapstruct, height), FIELDFLAG_READONLY, 0},
{"width", FIELDTYPE_UINT16, offsetof(mapstruct, width), FIELDFLAG_READONLY, 0},
{"darkness", FIELDTYPE_UINT8, offsetof(mapstruct, darkness), 0, 0},
{"path", FIELDTYPE_SHSTR, offsetof(mapstruct, path), FIELDFLAG_READONLY, 0},
{"enter_x", FIELDTYPE_UINT8, offsetof(mapstruct, enter_x), 0, 0},
{"enter_y", FIELDTYPE_UINT8, offsetof(mapstruct, enter_y), 0, 0},
{"region", FIELDTYPE_REGION, offsetof(mapstruct, region), FIELDFLAG_READONLY, 0},
{"bg_music", FIELDTYPE_CSTR, offsetof(mapstruct, bg_music), 0, 0},
{"weather", FIELDTYPE_CSTR, offsetof(mapstruct, weather), 0, 0}
}
Map fields.
Definition at line 38 of file atrinik_map.c.
PyGetSetDef getseters[NUM_FIELDS+NUM_MAPFLAGS+1] [static] |
This is filled in when we initialize our map type.
Definition at line 650 of file atrinik_map.c.
char* mapflag_names[] [static] |
{
"f_outdoor", "f_unique", "f_fixed_rtime", "f_nomagic",
"f_nopriest", "f_noharm", "f_nosummon", "f_fixed_login",
"f_player_no_save", "f_unused2", "f_unused3", "f_pvp",
"f_no_save"
}
Map flags.
Definition at line 68 of file atrinik_map.c.
PyMethodDef MapMethods[] [static] |
{
{"GetFirstObject", (PyCFunction) Atrinik_Map_GetFirstObject, METH_VARARGS, 0},
{"GetLastObject", (PyCFunction) Atrinik_Map_GetLastObject, METH_VARARGS, 0},
{"GetLayer", (PyCFunction) Atrinik_Map_GetLayer, METH_VARARGS, 0},
{"GetMapFromCoord", (PyCFunction) Atrinik_Map_GetMapFromCoord, METH_VARARGS, 0},
{"PlaySound", (PyCFunction) Atrinik_Map_PlaySound, METH_VARARGS | METH_KEYWORDS, 0},
{"Message", (PyCFunction) Atrinik_Map_Message, METH_VARARGS | METH_KEYWORDS, 0},
{"CreateObject", (PyCFunction) Atrinik_Map_CreateObject, METH_VARARGS, 0},
{"CountPlayers", (PyCFunction) Atrinik_Map_CountPlayers, METH_NOARGS, 0},
{"GetPlayers", (PyCFunction) Atrinik_Map_GetPlayers, METH_NOARGS, 0},
{"Insert", (PyCFunction) Atrinik_Map_Insert, METH_VARARGS, 0},
{"Wall", (PyCFunction) Atrinik_Map_Wall, METH_VARARGS, 0},
{"Blocked", (PyCFunction) Atrinik_Map_Blocked, METH_VARARGS, 0},
{"FreeSpot", (PyCFunction) Atrinik_Map_FreeSpot, METH_VARARGS, 0},
{NULL, NULL, 0, 0}
}
Available Python methods for the AtrinikMap object
Definition at line 481 of file atrinik_map.c.
1.7.4