Crossfire Server  1.75.0
cfpython_map.cpp
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* CFPython - A Python module for Crossfire RPG. */
3 /* Version: 2.0beta8 (also known as "Alexander") */
4 /* Contact: yann.chachkoff@myrealbox.com */
5 /*****************************************************************************/
6 /* That code is placed under the GNU General Public Licence (GPL) */
7 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints) */
8 /*****************************************************************************/
9 /* CrossFire, A Multiplayer game for X-windows */
10 /* */
11 /* Copyright (C) 2000 Mark Wedel */
12 /* Copyright (C) 1992 Frank Tore Johansen */
13 /* */
14 /* This program is free software; you can redistribute it and/or modify */
15 /* it under the terms of the GNU General Public License as published by */
16 /* the Free Software Foundation; either version 2 of the License, or */
17 /* (at your option) any later version. */
18 /* */
19 /* This program is distributed in the hope that it will be useful, */
20 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
21 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
22 /* GNU General Public License for more details. */
23 /* */
24 /* You should have received a copy of the GNU General Public License */
25 /* along with this program; if not, write to the Free Software */
26 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 /* */
28 /*****************************************************************************/
29 
30 #include <cfpython.h>
31 #include <map>
32 
33 /* Table for keeping track of which PyObject goes with with Crossfire object */
34 static std::map<mapstruct *, Crossfire_Map *> map_assoc_table;
35 
36 static void add_map_assoc(mapstruct *key, Crossfire_Map *value) {
37  map_assoc_table[key] = value;
38 }
39 
41  auto f = map_assoc_table.find(key);
42  return f == map_assoc_table.end() ? nullptr : f->second;
43 }
44 
45 static void free_map_assoc(mapstruct *key) {
46  map_assoc_table.erase(key);
47 }
48 
49 
52  assert(map->map != NULL);
53  if (map->map->in_memory != MAP_IN_MEMORY) {
54  char* mapname = map->map->path;
55  int is_unique = cf_map_get_int_property(map->map, CFAPI_MAP_PROP_UNIQUE);
56  /* If the map is unique the path name will be freed. We need to handle that. */
57  if (is_unique) {
58  char* tmp = strdup(mapname);
59  if (!tmp) {
60  /* FIXME: We should fatal() here, but that doesn't exist in plugins. */
61  cf_log(llevError, "Out of memory in ensure_map_in_memory()!\n");
62  abort();
63  }
64  mapname = tmp;
65  }
66  cf_log(llevDebug, "MAP %s AIN'T READY ! Loading it...\n", mapname);
67  /* Map pointer may change for player unique maps. */
68  /* Also, is the MAP_PLAYER_UNIQUE logic correct? */
69  map->map = cf_map_get_map(mapname, is_unique ? MAP_PLAYER_UNIQUE : 0);
70  if (is_unique)
71  free(mapname);
72  }
73 }
74 
75 static PyObject *Map_GetDifficulty(Crossfire_Map *whoptr, void *closure) {
76  (void)closure;
77  MAPEXISTCHECK(whoptr);
78  return Py_BuildValue("i", cf_map_get_difficulty(whoptr->map));
79 }
80 
81 static PyObject *Map_GetPath(Crossfire_Map *whoptr, void *closure) {
82  (void)closure;
83  MAPEXISTCHECK(whoptr);
84  return Py_BuildValue("s", cf_map_get_sstring_property(whoptr->map, CFAPI_MAP_PROP_PATH));
85 }
86 
87 static PyObject *Map_GetTempName(Crossfire_Map *whoptr, void *closure) {
88  (void)closure;
89  MAPEXISTCHECK(whoptr);
90  return Py_BuildValue("s", cf_map_get_sstring_property(whoptr->map, CFAPI_MAP_PROP_TMPNAME));
91 }
92 
93 static PyObject *Map_GetName(Crossfire_Map *whoptr, void *closure) {
94  (void)closure;
95  MAPEXISTCHECK(whoptr);
96  return Py_BuildValue("s", cf_map_get_sstring_property(whoptr->map, CFAPI_MAP_PROP_NAME));
97 }
98 
99 static PyObject *Map_GetResetTime(Crossfire_Map *whoptr, void *closure) {
100  (void)closure;
101  MAPEXISTCHECK(whoptr);
102  return Py_BuildValue("i", cf_map_get_reset_time(whoptr->map));
103 }
104 
105 static PyObject *Map_GetResetTimeout(Crossfire_Map *whoptr, void *closure) {
106  (void)closure;
107  MAPEXISTCHECK(whoptr);
108  return Py_BuildValue("i", cf_map_get_reset_timeout(whoptr->map));
109 }
110 
111 static PyObject *Map_GetPlayers(Crossfire_Map *whoptr, void *closure) {
112  (void)closure;
113  MAPEXISTCHECK(whoptr);
114  return Py_BuildValue("i", cf_map_get_players(whoptr->map));
115 }
116 
117 static PyObject *Map_GetDarkness(Crossfire_Map *whoptr, void *closure) {
118  (void)closure;
119  MAPEXISTCHECK(whoptr);
120  return Py_BuildValue("i", cf_map_get_darkness(whoptr->map));
121 }
122 
123 static PyObject *Map_GetWidth(Crossfire_Map *whoptr, void *closure) {
124  (void)closure;
125  MAPEXISTCHECK(whoptr);
126  return Py_BuildValue("i", cf_map_get_width(whoptr->map));
127 }
128 
129 static PyObject *Map_GetHeight(Crossfire_Map *whoptr, void *closure) {
130  (void)closure;
131  MAPEXISTCHECK(whoptr);
132  return Py_BuildValue("i", cf_map_get_height(whoptr->map));
133 }
134 
135 static PyObject *Map_GetEnterX(Crossfire_Map *whoptr, void *closure) {
136  (void)closure;
137  MAPEXISTCHECK(whoptr);
138  return Py_BuildValue("i", cf_map_get_enter_x(whoptr->map));
139 }
140 
141 static PyObject *Map_GetEnterY(Crossfire_Map *whoptr, void *closure) {
142  (void)closure;
143  MAPEXISTCHECK(whoptr);
144  return Py_BuildValue("i", cf_map_get_enter_y(whoptr->map));
145 }
146 
147 static PyObject *Map_GetMessage(Crossfire_Map *whoptr, void *closure) {
148  (void)closure;
149  MAPEXISTCHECK(whoptr);
150  return Py_BuildValue("s", cf_map_get_sstring_property(whoptr->map, CFAPI_MAP_PROP_MESSAGE));
151 }
152 
153 static PyObject *Map_GetRegion(Crossfire_Map *whoptr, void *closure) {
154  (void)closure;
155  MAPEXISTCHECK(whoptr);
157 }
158 
159 static int Map_SetPath(Crossfire_Map *whoptr, PyObject *value, void *closure) {
160  const char *val;
161  (void)closure;
162 
163  MAPEXISTCHECK_INT(whoptr);
164  if (!PyArg_Parse(value, "s", &val))
165  return -1;
166 
168  return 0;
169 
170 }
171 
172 static PyObject *Map_GetUnique(Crossfire_Map *whoptr, void *closure) {
173  (void)closure;
174  MAPEXISTCHECK(whoptr);
175  return Py_BuildValue("i", cf_map_get_int_property(whoptr->map, CFAPI_MAP_PROP_UNIQUE));
176 }
177 
178 static PyObject *Map_Message(Crossfire_Map *map, PyObject *args) {
179  int color = NDI_BLUE|NDI_UNIQUE;
180  char *message;
181 
182  if (!PyArg_ParseTuple(args, "s|i", &message, &color))
183  return NULL;
184 
185  MAPEXISTCHECK(map);
186 
187  cf_map_message(map->map, message, color);
188 
189  Py_INCREF(Py_None);
190  return Py_None;
191 }
192 
193 static PyObject *Map_GetFirstObjectAt(Crossfire_Map *map, PyObject *args) {
194  int x, y;
195  object *val;
196 
197  if (!PyArg_ParseTuple(args, "ii", &x, &y))
198  return NULL;
199 
200  MAPEXISTCHECK(map);
201 
202  /* make sure the map is swapped in */
204 
205  val = cf_map_get_object_at(map->map, x, y);
206  return Crossfire_Object_wrap(val);
207 }
208 
209 static PyObject *Map_CreateObject(Crossfire_Map *map, PyObject *args) {
210  char *txt;
211  int x, y;
212  object *op;
213 
214  if (!PyArg_ParseTuple(args, "sii", &txt, &x, &y))
215  return NULL;
216 
217  MAPEXISTCHECK(map);
218 
219  /* make sure the map is swapped in */
221 
222  op = cf_create_object_by_name(txt);
223 
224  if (op)
225  op = cf_map_insert_object(map->map, op, x, y);
226  return Crossfire_Object_wrap(op);
227 }
228 
229 static PyObject *Map_Check(Crossfire_Map *map, PyObject *args) {
230  char *what;
231  int x, y;
232  object *foundob;
233  int16_t nx, ny;
234  int mflags;
235 
236  if (!PyArg_ParseTuple(args, "s(ii)", &what, &x, &y))
237  return NULL;
238 
239  MAPEXISTCHECK(map);
240 
241  /* make sure the map is swapped in */
243 
244  mflags = cf_map_get_flags(map->map, &(map->map), (int16_t)x, (int16_t)y, &nx, &ny);
245  if (mflags&P_OUT_OF_MAP) {
246  Py_INCREF(Py_None);
247  return Py_None;
248  }
249  foundob = cf_map_find_by_archetype_name(what, map->map, nx, ny);
250  return Crossfire_Object_wrap(foundob);
251 }
252 
253 static PyObject *Map_Next(Crossfire_Map *map, PyObject *args) {
254  (void)args;
255  MAPEXISTCHECK(map);
257 }
258 
259 static PyObject *Map_Insert(Crossfire_Map *map, PyObject *args) {
260  int x, y;
261  Crossfire_Object *what;
262 
263  if (!PyArg_ParseTuple(args, "O!ii", &Crossfire_ObjectType, &what, &x, &y))
264  return NULL;
265 
266  MAPEXISTCHECK(map);
267 
268  /* make sure the map is swapped in */
270 
271  return Crossfire_Object_wrap(cf_map_insert_object(map->map, what->obj, x, y));
272 }
273 
274 static PyObject *Map_InsertAround(Crossfire_Map *map, PyObject *args) {
275  int x, y;
276  Crossfire_Object *what;
277 
278  if (!PyArg_ParseTuple(args, "O!ii", &Crossfire_ObjectType, &what, &x, &y))
279  return NULL;
280 
281  MAPEXISTCHECK(map);
282 
283  /* make sure the map is swapped in */
285 
286  return Crossfire_Object_wrap(cf_map_insert_object_around(map->map, what->obj, x, y));
287 }
288 
289 static PyObject *Map_ChangeLight(Crossfire_Map *map, PyObject *args) {
290  int change;
291 
292  if (!PyArg_ParseTuple(args, "i", &change))
293  return NULL;
294 
295  MAPEXISTCHECK(map);
296 
297  return Py_BuildValue("i", cf_map_change_light(map->map, change));
298 }
314 static PyObject *Map_TriggerConnected(Crossfire_Map *map, PyObject *args) {
315  objectlink *ol = NULL;
316  int connected;
317  int state;
318  Crossfire_Object *cause = NULL;
319  oblinkpt *olp;
320 
321  if (!PyArg_ParseTuple(args, "ii|O!", &connected, &state, &Crossfire_ObjectType, &cause))
322  return NULL;
323 
324  MAPEXISTCHECK(map);
325 
326  /* make sure the map is swapped in */
328 
329  /* locate objectlink for this connected value */
330  if (!map->map->buttons) {
331  cf_log(llevError, "Map %s called for trigger on connected %d but there ain't any button list for that map!\n", cf_map_get_sstring_property(map->map, CFAPI_MAP_PROP_PATH), connected);
332  PyErr_SetString(PyExc_ReferenceError, "No objects connected to that ID on this map.");
333  return NULL;
334  }
335  for (olp = map->map->buttons; olp; olp = olp->next) {
336  if (olp->value == connected) {
337  ol = olp->link;
338  break;
339  }
340  }
341  if (ol == NULL) {
342  cf_log(llevInfo, "Map %s called for trigger on connected %d but there ain't any button list for that map!\n", cf_map_get_sstring_property(map->map, CFAPI_MAP_PROP_PATH), connected);
343  /* FIXME: I'm not sure about this message... */
344  PyErr_SetString(PyExc_ReferenceError, "No objects with that connection ID on this map.");
345  return NULL;
346  }
347  /* run the object link */
348  cf_map_trigger_connected(ol, cause ? cause->obj : NULL, state);
349 
350  Py_INCREF(Py_None);
351  return Py_None;
352 }
353 
355  MAPEXISTCHECK_INT(left);
356  MAPEXISTCHECK_INT(right);
357  return left->map < right->map ? -1 : (left->map == right->map ? 0 : 1);
358 }
359 
360 static PyObject *Crossfire_Map_RichCompare(Crossfire_Map *left, Crossfire_Map *right, int op) {
361  int result;
362  if (!left
363  || !right
364  || !PyObject_TypeCheck((PyObject*)left, &Crossfire_MapType)
365  || !PyObject_TypeCheck((PyObject*)right, &Crossfire_MapType)) {
366  Py_INCREF(Py_NotImplemented);
367  return Py_NotImplemented;
368  }
369  result = Map_InternalCompare(left, right);
370  /* Handle removed maps. */
371  if (result == -1 && PyErr_Occurred())
372  return NULL;
373  /* Based on how Python 3.0 (GPL compatible) implements it for internal types: */
374  switch (op) {
375  case Py_EQ:
376  result = (result == 0);
377  break;
378  case Py_NE:
379  result = (result != 0);
380  break;
381  case Py_LE:
382  result = (result <= 0);
383  break;
384  case Py_GE:
385  result = (result >= 0);
386  break;
387  case Py_LT:
388  result = (result == -1);
389  break;
390  case Py_GT:
391  result = (result == 1);
392  break;
393  }
394  return PyBool_FromLong(result);
395 }
396 
397 /* Legacy code: convert to long so that non-object functions work correctly */
398 static PyObject *Crossfire_Map_Long(PyObject *obj) {
400  return Py_BuildValue("l", ((Crossfire_Map *)obj)->map);
401 }
402 
406 static PyObject *Crossfire_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
407  Crossfire_Map *self;
408  (void)args;
409  (void)kwds;
410 
411  self = (Crossfire_Map *)type->tp_alloc(type, 0);
412  if (self)
413  self->map = NULL;
414 
415  return (PyObject *)self;
416 }
417 
418 static void Crossfire_Map_dealloc(PyObject *obj) {
419  Crossfire_Map *self;
420 
421  self = (Crossfire_Map *)obj;
422  if (self) {
423  if (self->map && self->valid) {
424  free_map_assoc(self->map);
425  }
426  Py_TYPE(self)->tp_free(obj);
427  }
428 }
429 
431  map->valid = 0;
432  free_map_assoc(map->map);
433 }
434 
435 PyObject *Crossfire_Map_wrap(mapstruct *what) {
436  Crossfire_Map *wrapper;
437 
438  /* return None if no object was to be wrapped */
439  if (what == NULL) {
440  Py_INCREF(Py_None);
441  return Py_None;
442  }
443 
444  wrapper = find_assoc_pymap(what);
445  if (!wrapper) {
446  wrapper = PyObject_NEW(Crossfire_Map, &Crossfire_MapType);
447  if (wrapper != NULL) {
448  wrapper->map = what;
449  wrapper->valid = 1;
450  add_map_assoc(what, wrapper);
451  }
452  } else {
453  Py_INCREF(wrapper);
454  }
455 
456  return (PyObject *)wrapper;
457 }
458 
459 /* Python binding */
460 static PyGetSetDef Map_getseters[] = {
461  { "Difficulty", (getter)Map_GetDifficulty, NULL, NULL, NULL },
462  { "Path", (getter)Map_GetPath, (setter)Map_SetPath, NULL, NULL },
463  { "TempName", (getter)Map_GetTempName, NULL, NULL, NULL },
464  { "Name", (getter)Map_GetName, NULL, NULL, NULL },
465  { "ResetTime", (getter)Map_GetResetTime, NULL, NULL, NULL },
466  { "ResetTimeout", (getter)Map_GetResetTimeout, NULL, NULL, NULL },
467  { "Players", (getter)Map_GetPlayers, NULL, NULL, NULL },
468  { "Light", (getter)Map_GetDarkness, NULL, NULL, NULL },
469  { "Darkness", (getter)Map_GetDarkness, NULL, NULL, NULL },
470  { "Width", (getter)Map_GetWidth, NULL, NULL, NULL },
471  { "Height", (getter)Map_GetHeight, NULL, NULL, NULL },
472  { "EnterX", (getter)Map_GetEnterX, NULL, NULL, NULL },
473  { "EnterY", (getter)Map_GetEnterY, NULL, NULL, NULL },
474  { "Message", (getter)Map_GetMessage, NULL, NULL, NULL },
475  { "Region", (getter)Map_GetRegion, NULL, NULL, NULL },
476  { "Unique", (getter)Map_GetUnique, NULL, NULL, NULL },
477  { NULL, NULL, NULL, NULL, NULL }
478 };
479 
480 static PyMethodDef MapMethods[] = {
481  { "Print", (PyCFunction)Map_Message, METH_VARARGS, NULL },
482  { "ObjectAt", (PyCFunction)Map_GetFirstObjectAt, METH_VARARGS, NULL },
483  { "CreateObject", (PyCFunction)Map_CreateObject, METH_VARARGS, NULL },
484  { "Check", (PyCFunction)Map_Check, METH_VARARGS, NULL },
485  { "Next", (PyCFunction)Map_Next, METH_NOARGS, NULL },
486  { "Insert", (PyCFunction)Map_Insert, METH_VARARGS, NULL },
487  { "InsertAround", (PyCFunction)Map_InsertAround, METH_VARARGS, NULL },
488  { "ChangeLight", (PyCFunction)Map_ChangeLight, METH_VARARGS, NULL },
489  { "TriggerConnected", (PyCFunction)Map_TriggerConnected, METH_VARARGS, NULL },
490  { NULL, NULL, 0, NULL }
491 };
492 
494 
495 /* Our actual Python MapType */
498  &MapConvert,
499  PyObject_HashNotImplemented,
500  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
501  "Crossfire maps",
502  (richcmpfunc) Crossfire_Map_RichCompare,
503  MapMethods,
505  NULL,
507  );
Error, serious thing.
Definition: logger.h:11
void cf_map_message(mapstruct *m, const char *msg, int color)
Partial wrapper for ext_info_map().
PyObject_HEAD object * obj
#define CFAPI_MAP_PROP_NAME
Definition: plugin.h:250
Information.
Definition: logger.h:12
void Handle_Map_Unload_Hook(Crossfire_Map *map)
PyObject * Crossfire_Region_wrap(region *what)
oblinkpt * next
Next value in the list.
Definition: object.h:472
static PyObject * Map_InsertAround(Crossfire_Map *map, PyObject *args)
static PyObject * Map_Insert(Crossfire_Map *map, PyObject *args)
static PyObject * Map_TriggerConnected(Crossfire_Map *map, PyObject *args)
Python backend method for Map.TriggerConnected(int connected, CfObject cause, int state) ...
static PyObject * Map_GetPlayers(Crossfire_Map *whoptr, void *closure)
PyObject * Crossfire_Map_wrap(mapstruct *what)
PyTypeObject Crossfire_MapType
static PyObject * Map_GetDarkness(Crossfire_Map *whoptr, void *closure)
#define MAPEXISTCHECK_INT(map)
Definition: cfpython_map.h:47
static void ensure_map_in_memory(Crossfire_Map *map)
This makes sure the map is in memory and not swapped out.
static PyObject * Map_ChangeLight(Crossfire_Map *map, PyObject *args)
static PyObject * Map_GetName(Crossfire_Map *whoptr, void *closure)
#define MAPEXISTCHECK(map)
Definition: cfpython_map.h:40
int cf_map_change_light(mapstruct *m, int change)
Wrapper for change_map_light().
region * cf_map_get_region_property(mapstruct *map, int propcode)
#define NDI_BLUE
Actually, it is Dodger Blue.
Definition: newclient.h:251
static PyObject * Map_Message(Crossfire_Map *map, PyObject *args)
int cf_map_get_height(mapstruct *map)
int cf_map_get_difficulty(mapstruct *map)
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
PyObject * Crossfire_Object_wrap(object *what)
Python initialized.
static void add_map_assoc(mapstruct *key, Crossfire_Map *value)
static PyObject * Map_GetHeight(Crossfire_Map *whoptr, void *closure)
#define CFAPI_MAP_PROP_NEXT
Definition: plugin.h:261
static PyObject * Map_GetDifficulty(Crossfire_Map *whoptr, void *closure)
static Crossfire_Map * find_assoc_pymap(mapstruct *key)
oblinkpt * buttons
Linked list of linked lists of buttons.
Definition: map.h:349
long value
Used as connected value in buttons/gates.
Definition: object.h:471
int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
Wrapper for get_map_flags().
static PyObject * Map_GetEnterY(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)
Used to link together several object links.
Definition: object.h:469
static int Map_InternalCompare(Crossfire_Map *left, Crossfire_Map *right)
static PyMethodDef MapMethods[]
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
#define MAP_IN_MEMORY
Map is fully loaded.
Definition: map.h:129
static PyObject * Map_GetWidth(Crossfire_Map *whoptr, void *closure)
int cf_map_get_players(mapstruct *map)
object * cf_map_insert_object_around(mapstruct *where, object *op, int x, int y)
Will insert op in the map where around the spot x, y.
static PyObject * Crossfire_Map_Long(PyObject *obj)
#define CFAPI_MAP_PROP_UNIQUE
Definition: plugin.h:263
static PyObject * Map_GetRegion(Crossfire_Map *whoptr, void *closure)
char path[HUGE_BUF]
Filename of the map.
Definition: map.h:360
One map for a player.
Definition: newserver.h:52
static PyGetSetDef Map_getseters[]
mapstruct * cf_map_get_map(const char *name, int flags)
Wrapper for ready_map_name().
This is a game-map.
Definition: map.h:320
static PyObject * Map_CreateObject(Crossfire_Map *map, PyObject *args)
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
Wrapper for object_insert_in_map_at().
int cf_map_get_reset_time(mapstruct *map)
PyObject_HEAD mapstruct * map
Definition: cfpython_map.h:34
#define P_OUT_OF_MAP
This space is outside the map.
Definition: map.h:254
#define CFAPI_MAP_PROP_MESSAGE
Definition: plugin.h:260
objectlink * link
Items for this value.
Definition: object.h:470
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
#define CFAPI_MAP_PROP_TMPNAME
Definition: plugin.h:249
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
Kinda wrapper for map_find_by_archetype_name().
int cf_map_get_reset_timeout(mapstruct *map)
int cf_map_get_darkness(mapstruct *map)
static PyObject * Map_GetEnterX(Crossfire_Map *whoptr, void *closure)
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
Wrapper for trigger_connected().
object * cf_map_get_object_at(mapstruct *m, int x, int y)
Wrapper for GET_MAP_OB().
uint32_t in_memory
Combination of IN_MEMORY_xxx flags.
Definition: map.h:340
static void free_map_assoc(mapstruct *key)
static PyObject * Map_GetFirstObjectAt(Crossfire_Map *map, PyObject *args)
#define MAP_PLAYER_UNIQUE
This map is player-specific.
Definition: map.h:95
static PyObject * Map_GetTempName(Crossfire_Map *whoptr, void *closure)
Only for debugging purposes.
Definition: logger.h:13
#define CFAPI_MAP_PROP_PATH
Definition: plugin.h:248
static std::map< mapstruct *, Crossfire_Map * > map_assoc_table
int cf_map_get_enter_y(mapstruct *map)
#define CFAPI_MAP_PROP_REGION
Definition: plugin.h:262
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
static PyObject * Map_Check(Crossfire_Map *map, PyObject *args)
PyTypeObject Crossfire_ObjectType
CF_PYTHON_NUMBER_METHODS(Map, Crossfire_Map_Long)
static PyObject * Map_GetUnique(Crossfire_Map *whoptr, void *closure)
#define NDI_UNIQUE
Print immediately, don&#39;t buffer.
Definition: newclient.h:270
static PyObject * Map_GetMessage(Crossfire_Map *whoptr, void *closure)
static PyObject * Map_GetResetTimeout(Crossfire_Map *whoptr, void *closure)
static int Map_SetPath(Crossfire_Map *whoptr, PyObject *value, void *closure)
static PyObject * Map_GetPath(Crossfire_Map *whoptr, void *closure)
static PyObject * Crossfire_Map_RichCompare(Crossfire_Map *left, Crossfire_Map *right, int op)
int cf_map_get_int_property(mapstruct *map, int property)
static PyObject * Crossfire_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Python initialized.
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
int cf_map_get_width(mapstruct *map)
static PyObject * Map_Next(Crossfire_Map *map, PyObject *args)
static PyObject * Map_GetResetTime(Crossfire_Map *whoptr, void *closure)
static void Crossfire_Map_dealloc(PyObject *obj)
int cf_map_get_enter_x(mapstruct *map)