Atrinik Server  4.0
Functions | Variables
atrinik_region.c File Reference
#include <plugin_python.h>

Go to the source code of this file.

Functions

static PyObject * Region_GetAttribute (Atrinik_Region *r, void *context)
 
static PyObject * Atrinik_Region_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void Atrinik_Region_dealloc (Atrinik_Region *self)
 
static PyObject * Atrinik_Region_str (Atrinik_Region *self)
 
static int Atrinik_Region_InternalCompare (Atrinik_Region *left, Atrinik_Region *right)
 
static PyObject * Atrinik_Region_RichCompare (Atrinik_Region *left, Atrinik_Region *right, int op)
 
int Atrinik_Region_init (PyObject *module)
 
PyObject * wrap_region (region_struct *what)
 

Variables

static fields_struct fields []
 
static PyGetSetDef getseters [NUM_FIELDS+1]
 
PyTypeObject Atrinik_RegionType
 

Detailed Description

Atrinik Python plugin region related code.

Author
Alex Tokar

Definition in file atrinik_region.c.

Function Documentation

static void Atrinik_Region_dealloc ( Atrinik_Region self)
static

Free a region wrapper.

Parameters
selfThe wrapper to free.

Definition at line 101 of file atrinik_region.c.

int Atrinik_Region_init ( PyObject *  module)

Initialize the region wrapper.

Parameters
moduleThe Atrinik Python module.
Returns
1 on success, 0 on failure.

Definition at line 196 of file atrinik_region.c.

static PyObject* Atrinik_Region_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Create a new region wrapper.

Parameters
typeType object.
argsUnused.
kwdsUnused.
Returns
The new wrapper.

Definition at line 85 of file atrinik_region.c.

static PyObject* Atrinik_Region_str ( Atrinik_Region self)
static

Return a string representation of a region.

Parameters
selfThe region object.
Returns
Python object containing the name of the region.

Definition at line 118 of file atrinik_region.c.

static PyObject* Region_GetAttribute ( Atrinik_Region r,
void *  context 
)
static

Get region's attribute.

Parameters
rPython region wrapper.
contextVoid pointer to the field ID.
Returns
Python object with the attribute value, NULL on failure.

Definition at line 69 of file atrinik_region.c.

PyObject* wrap_region ( region_struct what)

Utility method to wrap a region.

Parameters
whatRegion to wrap.
Returns
Python object wrapping the real region.

Definition at line 232 of file atrinik_region.c.

Variable Documentation

PyTypeObject Atrinik_RegionType

Our actual Python RegionType.

Definition at line 150 of file atrinik_region.c.

fields_struct fields[]
static
Initial value:
= {
{"next", FIELDTYPE_REGION, offsetof(region_struct, next), 0, 0,
"Next region in a linked list.; Atrinik.Region.Region or None "
"(readonly)"},
{"parent", FIELDTYPE_REGION, offsetof(region_struct, parent), 0, 0,
"Region's parent.; Atrinik.Region.Region or None (readonly)"},
{"name", FIELDTYPE_CSTR, offsetof(region_struct, name), 0, 0,
"Name of the region (eg, 'world').; str (readonly)"},
{"longname", FIELDTYPE_CSTR, offsetof(region_struct, longname), 0, 0,
"Long name (eg, 'Strakewood Island').; str or None (readonly)"},
{"msg", FIELDTYPE_CSTR, offsetof(region_struct, msg), 0, 0,
"Description of the region.; str or None (readonly)"},
{"jailmap", FIELDTYPE_CSTR, offsetof(region_struct, jailmap), 0, 0,
"Path to the region's jail map.; str or None (readonly)"},
{"jailx", FIELDTYPE_INT16, offsetof(region_struct, jailx), 0, 0,
"X coordinate of the region's jail.; int (readonly)"},
{"jaily", FIELDTYPE_INT16, offsetof(region_struct, jaily), 0, 0,
"Y coordinate of the region's jail.; int (readonly)"},
{"map_first", FIELDTYPE_CSTR, offsetof(region_struct, map_first), 0, 0,
"Path to some beginning map in the region. Used for world maker "
"generation purposes.; str or None (readonly)"}
}
struct sound_ambient_match * next
Next match rule in a linked list.
Definition: sound_ambient.c:39

Region fields.

Definition at line 37 of file atrinik_region.c.

PyGetSetDef getseters[NUM_FIELDS+1]
static

This is filled in when we initialize our region type.

Definition at line 147 of file atrinik_region.c.