Go to the documentation of this file.
56 assert(
map->map != NULL);
168 if (!PyArg_Parse(
value,
"s", &val))
201 if (!PyArg_ParseTuple(
args,
"ii", &
x, &
y))
218 if (!PyArg_ParseTuple(
args,
"sii", &txt, &
x, &
y))
240 if (!PyArg_ParseTuple(
args,
"s(ii)", &what, &
x, &
y))
296 if (!PyArg_ParseTuple(
args,
"i", &change))
334 if (!
map->map->buttons) {
336 PyErr_SetString(PyExc_ReferenceError,
"No objects connected to that ID on this map.");
339 for (olp =
map->map->buttons; olp; olp = olp->
next) {
348 PyErr_SetString(PyExc_ReferenceError,
"No objects with that connection ID on this map.");
361 return left->
map < right->
map ? -1 : (left->
map == right->
map ? 0 : 1);
370 Py_INCREF(Py_NotImplemented);
371 return Py_NotImplemented;
375 if (
result == -1 && PyErr_Occurred())
398 return PyBool_FromLong(
result);
419 return (PyObject *)
self;
427 if (self->map && self->valid) {
430 Py_TYPE(
self)->tp_free(
obj);
451 if (wrapper != NULL) {
460 return (PyObject *)wrapper;
481 { NULL, NULL, NULL, NULL, NULL }
485 {
"Print", (PyCFunction)
Map_Message, METH_VARARGS, NULL },
488 {
"Check", (PyCFunction)
Map_Check, METH_VARARGS, NULL },
489 {
"Next", (PyCFunction)
Map_Next, METH_NOARGS, NULL },
490 {
"Insert", (PyCFunction)
Map_Insert, METH_VARARGS, NULL },
494 { NULL, NULL, 0, NULL }
503 PyObject_HashNotImplemented,
504 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
region * cf_map_get_region_property(mapstruct *map, int propcode)
#define MAPEXISTCHECK_INT(map)
static PyObject * Map_Message(Crossfire_Map *map, PyObject *args)
void cf_log(LogLevel logLevel, const char *format,...)
int cf_map_get_height(mapstruct *map)
PyObject_HEAD object * obj
static int Map_SetPath(Crossfire_Map *whoptr, PyObject *value, void *closure)
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
PyObject * Crossfire_Map_wrap(mapstruct *what)
#define CFAPI_MAP_PROP_TMPNAME
static PyObject * Map_GetResetTime(Crossfire_Map *whoptr, void *closure)
static PyObject * Map_GetTempName(Crossfire_Map *whoptr, void *closure)
int cf_map_get_int_property(mapstruct *map, int property)
int cf_map_get_players(mapstruct *map)
static PyObject * Map_GetUnique(Crossfire_Map *whoptr, void *closure)
static int Map_InternalCompare(Crossfire_Map *left, Crossfire_Map *right)
PyObject * Crossfire_Region_wrap(region *what)
#define CFAPI_MAP_PROP_NEXT
static void add_map_assoc(mapstruct *key, Crossfire_Map *value)
static PyObject * Map_GetName(Crossfire_Map *whoptr, void *closure)
void free_ptr_assoc(ptr_assoc **hash_table, void *key)
object * cf_create_object_by_name(const char *name)
static PyObject * Crossfire_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
int cf_map_get_reset_time(mapstruct *map)
PyObject * Crossfire_Object_wrap(object *what)
object * cf_map_insert_object_around(mapstruct *where, object *op, int x, int y)
CF_PYTHON_NUMBER_METHODS(Map, Crossfire_Map_Long)
#define MAP_PLAYER_UNIQUE
static PyObject * Crossfire_Map_RichCompare(Crossfire_Map *left, Crossfire_Map *right, int op)
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
#define CFAPI_MAP_PROP_UNIQUE
static PyObject * Map_GetEnterY(Crossfire_Map *whoptr, void *closure)
void Handle_Map_Unload_Hook(Crossfire_Map *map)
static PyObject * Map_GetPlayers(Crossfire_Map *whoptr, void *closure)
#define MAPEXISTCHECK(map)
#define CFAPI_MAP_PROP_REGION
void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value)
void init_ptr_assoc_table(ptr_assoc **hash_table)
PyObject_HEAD mapstruct * map
static PyObject * Map_InsertAround(Crossfire_Map *map, PyObject *args)
object * cf_map_get_object_at(mapstruct *m, int x, int y)
void init_map_assoc_table(void)
static PyObject * Map_CreateObject(Crossfire_Map *map, PyObject *args)
#define CFAPI_MAP_PROP_MESSAGE
int cf_map_get_enter_y(mapstruct *map)
static PyObject * Map_GetWidth(Crossfire_Map *whoptr, void *closure)
static void ensure_map_in_memory(Crossfire_Map *map)
static PyObject * Map_GetDarkness(Crossfire_Map *whoptr, void *closure)
static ptr_assoc_table map_assoc_table
static PyObject * Crossfire_Map_Long(PyObject *obj)
static PyObject * Map_GetDifficulty(Crossfire_Map *whoptr, void *closure)
static PyObject * Map_GetHeight(Crossfire_Map *whoptr, void *closure)
#define CFAPI_MAP_PROP_PATH
void cf_map_message(mapstruct *m, const char *msg, int color)
int cf_map_get_reset_timeout(mapstruct *map)
static PyObject * Map_GetEnterX(Crossfire_Map *whoptr, void *closure)
int cf_map_get_enter_x(mapstruct *map)
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
static void free_map_assoc(mapstruct *key)
int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
static PyObject * find_assoc_pymap(mapstruct *key)
#define CFAPI_MAP_PROP_NAME
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
static PyObject * Map_GetMessage(Crossfire_Map *whoptr, void *closure)
static PyObject * Map_Insert(Crossfire_Map *map, PyObject *args)
ptr_assoc * ptr_assoc_table[PTR_ASSOC_TABLESIZE]
static PyObject * Map_GetPath(Crossfire_Map *whoptr, void *closure)
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
static PyObject * Map_TriggerConnected(Crossfire_Map *map, PyObject *args)
static PyObject * Map_GetRegion(Crossfire_Map *whoptr, void *closure)
CF_PYTHON_OBJECT(Map, Crossfire_Map_dealloc, &MapConvert, PyObject_HashNotImplemented, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, "Crossfire maps",(richcmpfunc) Crossfire_Map_RichCompare, MapMethods, Map_getseters, NULL, Crossfire_Map_new)
static PyObject * Map_ChangeLight(Crossfire_Map *map, PyObject *args)
static PyObject * Map_Check(Crossfire_Map *map, PyObject *args)
static PyObject * Map_Next(Crossfire_Map *map, PyObject *args)
static PyMethodDef MapMethods[]
int cf_map_get_difficulty(mapstruct *map)
int cf_map_get_darkness(mapstruct *map)
mapstruct * cf_map_get_map(const char *name, int flags)
static PyObject * Map_GetResetTimeout(Crossfire_Map *whoptr, void *closure)
void * find_assoc_value(ptr_assoc **hash_table, void *key)
static PyObject * Map_GetFirstObjectAt(Crossfire_Map *map, PyObject *args)
PyTypeObject Crossfire_ObjectType
static PyGetSetDef Map_getseters[]
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
int cf_map_get_width(mapstruct *map)
int cf_map_change_light(mapstruct *m, int change)
static void Crossfire_Map_dealloc(PyObject *obj)
PyTypeObject Crossfire_MapType