Crossfire Server, Branches 1.12  R18729
cfpython_region.c
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>
32 
33 static PyObject *Crossfire_Region_GetName(Crossfire_Region *regionptr, void *closure) {
34  return Py_BuildValue("s", cf_region_get_name(regionptr->reg));
35 }
36 
37 static PyObject *Crossfire_Region_GetLongname(Crossfire_Region *regionptr, void *closure) {
38  return Py_BuildValue("s", cf_region_get_longname(regionptr->reg));
39 }
40 
41 static PyObject *Crossfire_Region_GetMessage(Crossfire_Region *regionptr, void *closure) {
42  return Py_BuildValue("s", cf_region_get_message(regionptr->reg));
43 }
44 
45 static PyObject *Crossfire_Region_GetNext(Crossfire_Region *party, void *closure) {
47 }
48 
49 static PyObject *Crossfire_Region_GetParent(Crossfire_Region *party, PyObject *args) {
51 }
52 
53 PyObject *Crossfire_Region_wrap(region *what) {
54  Crossfire_Region *wrapper;
55 
56  /* return None if no object was to be wrapped */
57  if (what == NULL) {
58  Py_INCREF(Py_None);
59  return Py_None;
60  }
61 
62  wrapper = PyObject_NEW(Crossfire_Region, &Crossfire_RegionType);
63  if (wrapper != NULL)
64  wrapper->reg = what;
65  return (PyObject *)wrapper;
66 }
67 
69  return (left->reg < right->reg ? -1 : (left->reg == right->reg ? 0 : 1));
70 }
PyObject * Crossfire_Region_wrap(region *what)
static PyObject * Crossfire_Region_GetName(Crossfire_Region *regionptr, void *closure)
static PyObject * Crossfire_Region_GetNext(Crossfire_Region *party, void *closure)
region * cf_region_get_parent(region *reg)
region * cf_region_get_next(region *reg)
const char * cf_region_get_message(region *reg)
Definition: map.h:297
static PyObject * Crossfire_Region_GetMessage(Crossfire_Region *regionptr, void *closure)
static PyObject * Crossfire_Region_GetParent(Crossfire_Region *party, PyObject *args)
const char * cf_region_get_name(region *reg)
PyObject_HEAD region * reg
static int Crossfire_Region_InternalCompare(Crossfire_Region *left, Crossfire_Region *right)
static PyObject * Crossfire_Region_GetLongname(Crossfire_Region *regionptr, void *closure)
const char * cf_region_get_longname(region *reg)
PyTypeObject Crossfire_RegionType