2003-11-10 00:36:11 +01:00
|
|
|
|
#include <config.h>
|
|
|
|
|
#include <eressea.h>
|
2003-12-14 11:02:29 +01:00
|
|
|
|
#include "list.h"
|
2005-11-26 16:28:11 +01:00
|
|
|
|
#include "objects.h"
|
2003-11-10 00:36:11 +01:00
|
|
|
|
|
|
|
|
|
// kernel includes
|
2005-01-01 12:48:36 +01:00
|
|
|
|
#include <kernel/building.h>
|
2005-11-20 13:58:59 +01:00
|
|
|
|
#include <kernel/faction.h>
|
2005-01-13 13:42:36 +01:00
|
|
|
|
#include <kernel/item.h>
|
2004-04-11 01:21:58 +02:00
|
|
|
|
#include <kernel/plane.h>
|
|
|
|
|
#include <kernel/region.h>
|
|
|
|
|
#include <kernel/ship.h>
|
2005-10-25 14:38:01 +02:00
|
|
|
|
#include <kernel/terrain.h>
|
2005-01-01 12:48:36 +01:00
|
|
|
|
#include <kernel/unit.h>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#include <util/attrib.h>
|
2007-08-05 14:19:56 +02:00
|
|
|
|
#include <util/log.h>
|
2007-06-20 02:34:02 +02:00
|
|
|
|
|
2007-01-13 22:29:57 +01:00
|
|
|
|
#include <attributes/key.h>
|
|
|
|
|
|
2003-11-10 00:36:11 +01:00
|
|
|
|
// lua includes
|
|
|
|
|
#include <lua.hpp>
|
|
|
|
|
#include <luabind/luabind.hpp>
|
|
|
|
|
#include <luabind/iterator_policy.hpp>
|
2006-01-02 21:24:33 +01:00
|
|
|
|
#if LUABIND_BETA >= 7
|
2004-09-11 19:29:13 +02:00
|
|
|
|
# include <luabind/operator.hpp>
|
|
|
|
|
#endif
|
2003-11-10 00:36:11 +01:00
|
|
|
|
|
2004-04-11 18:16:26 +02:00
|
|
|
|
#include <ostream>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
using namespace luabind;
|
|
|
|
|
|
2004-06-26 22:51:19 +02:00
|
|
|
|
static eressea::list<region *>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
get_regions(void) {
|
2004-06-26 22:51:19 +02:00
|
|
|
|
return eressea::list<region *>(regions);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-06-26 22:51:19 +02:00
|
|
|
|
static eressea::list<unit *>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
region_units(const region& r) {
|
2004-06-26 22:51:19 +02:00
|
|
|
|
return eressea::list<unit *>(r.units);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-06-26 22:51:19 +02:00
|
|
|
|
static eressea::list<building *>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
region_buildings(const region& r) {
|
2004-06-26 22:51:19 +02:00
|
|
|
|
return eressea::list<building *>(r.buildings);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-06-26 22:51:19 +02:00
|
|
|
|
static eressea::list<ship *>
|
2003-11-10 00:36:11 +01:00
|
|
|
|
region_ships(const region& r) {
|
2004-06-26 22:51:19 +02:00
|
|
|
|
return eressea::list<ship *>(r.ships);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
region_setname(region& r, const char * name) {
|
2007-08-10 09:03:23 +02:00
|
|
|
|
if (r.land) rsetname((&r), name);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2003-12-14 20:17:59 +01:00
|
|
|
|
static const char *
|
|
|
|
|
region_getterrain(const region& r) {
|
2007-07-21 17:35:07 +02:00
|
|
|
|
return (const char *)r.terrain->_name;
|
2003-12-14 20:17:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2003-11-10 00:36:11 +01:00
|
|
|
|
static const char *
|
|
|
|
|
region_getname(const region& r) {
|
2007-07-21 17:35:07 +02:00
|
|
|
|
if (r.land) return (const char *)r.land->name;
|
2006-01-01 17:58:59 +01:00
|
|
|
|
return NULL;
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-20 13:58:59 +01:00
|
|
|
|
static void
|
|
|
|
|
lua_region_setowner(region& r, faction * f) {
|
|
|
|
|
region_setowner(&r, f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static faction *
|
|
|
|
|
lua_region_getowner(const region& r) {
|
|
|
|
|
return region_owner(&r);
|
|
|
|
|
}
|
|
|
|
|
|
2006-05-08 22:28:53 +02:00
|
|
|
|
static void
|
|
|
|
|
region_setherbtype(region& r, const char * str) {
|
|
|
|
|
const struct resource_type * rtype = rt_find(str);
|
|
|
|
|
if (rtype!=NULL && rtype->itype!=NULL) {
|
|
|
|
|
rsetherbtype(&r, rtype->itype);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
|
region_getherbtype(const region& r) {
|
|
|
|
|
const struct item_type * itype = rherbtype(&r);
|
|
|
|
|
if (itype==NULL) return NULL;
|
|
|
|
|
return itype->rtype->_name[0];
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-10 00:36:11 +01:00
|
|
|
|
static void
|
2007-07-20 09:28:11 +02:00
|
|
|
|
region_setinfo(region& r, const char * info)
|
|
|
|
|
{
|
|
|
|
|
free(r.display);
|
2007-08-10 09:03:23 +02:00
|
|
|
|
r.display = strdup(info);
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
|
region_getinfo(const region& r) {
|
2007-07-21 17:35:07 +02:00
|
|
|
|
return (const char *)r.display;
|
2003-11-10 00:36:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-08 22:28:53 +02:00
|
|
|
|
static int
|
2004-04-11 01:21:58 +02:00
|
|
|
|
region_plane(const region& r)
|
|
|
|
|
{
|
|
|
|
|
if (r.planep==NULL) return 0;
|
|
|
|
|
return r.planep->id;
|
|
|
|
|
}
|
|
|
|
|
|
2004-04-11 02:45:12 +02:00
|
|
|
|
static void
|
|
|
|
|
region_addnotice(region& r, const char * str)
|
|
|
|
|
{
|
2007-08-10 09:03:23 +02:00
|
|
|
|
addmessage(&r, NULL, str, MSG_MESSAGE, ML_IMPORTANT);
|
2004-04-11 02:45:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-08 22:28:53 +02:00
|
|
|
|
static std::ostream&
|
2004-09-26 20:00:49 +02:00
|
|
|
|
operator<<(std::ostream& stream, const region& r)
|
2004-04-11 18:16:26 +02:00
|
|
|
|
{
|
|
|
|
|
stream << regionname(&r, NULL) << ", " << region_getterrain(r);
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
2006-05-08 22:28:53 +02:00
|
|
|
|
static bool
|
2004-04-11 18:16:26 +02:00
|
|
|
|
operator==(const region& a, const region&b)
|
|
|
|
|
{
|
|
|
|
|
return a.x==b.x && a.y==b.y;
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-30 14:09:45 +02:00
|
|
|
|
static bool
|
|
|
|
|
region_getflag(const region& r, int bit)
|
|
|
|
|
{
|
|
|
|
|
if (r.flags & (1<<bit)) return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
region_setflag(region& r, int bit, bool set)
|
|
|
|
|
{
|
|
|
|
|
if (set) r.flags |= (1<<bit);
|
|
|
|
|
else r.flags &= ~(1<<bit);
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-13 13:42:36 +01:00
|
|
|
|
static int
|
|
|
|
|
region_getresource(const region& r, const char * type)
|
|
|
|
|
{
|
2006-05-08 22:28:53 +02:00
|
|
|
|
const resource_type * rtype = rt_find(type);
|
2005-12-11 10:58:17 +01:00
|
|
|
|
if (rtype!=NULL) {
|
|
|
|
|
if (rtype==rt_find("money")) return rmoney(&r);
|
2007-08-28 08:19:31 +02:00
|
|
|
|
if (rtype==rt_find("horse")) return rhorses(&r);
|
2005-12-11 10:58:17 +01:00
|
|
|
|
if (rtype==rt_find("peasant")) return rpeasants(&r);
|
|
|
|
|
} else {
|
2006-02-10 23:24:20 +01:00
|
|
|
|
if (strcmp(type, "seed")==0) return rtrees(&r, 0);
|
|
|
|
|
if (strcmp(type, "sapling")==0) return rtrees(&r, 1);
|
2005-12-11 10:58:17 +01:00
|
|
|
|
if (strcmp(type, "tree")==0) return rtrees(&r, 2);
|
|
|
|
|
if (strcmp(type, "grave")==0) return deathcount(&r);
|
|
|
|
|
if (strcmp(type, "chaos")==0) return chaoscount(&r);
|
|
|
|
|
}
|
2006-05-08 22:28:53 +02:00
|
|
|
|
return 0;
|
2005-01-13 13:42:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-10-09 23:41:04 +02:00
|
|
|
|
static void
|
2005-10-09 23:48:56 +02:00
|
|
|
|
region_setresource(region& r, const char * type, int value)
|
2005-10-09 23:41:04 +02:00
|
|
|
|
{
|
|
|
|
|
const resource_type * rtype = rt_find(type);
|
2005-12-11 10:58:17 +01:00
|
|
|
|
if (rtype!=NULL) {
|
|
|
|
|
if (rtype==rt_find("money")) rsetmoney(&r, value);
|
2007-08-28 08:19:31 +02:00
|
|
|
|
else if (rtype==rt_find("peasant")) rsetpeasants(&r, value);
|
|
|
|
|
else if (rtype==rt_find("horse")) rsethorses(&r, value);
|
2005-12-11 10:58:17 +01:00
|
|
|
|
} else {
|
2006-02-10 23:24:20 +01:00
|
|
|
|
if (strcmp(type, "seed")==0) {
|
2006-02-11 09:31:18 +01:00
|
|
|
|
rsettrees(&r, 0, value);
|
2006-02-10 23:24:20 +01:00
|
|
|
|
} else if (strcmp(type, "sapling")==0) {
|
2006-02-11 09:31:18 +01:00
|
|
|
|
rsettrees(&r, 1, value);
|
2006-02-10 23:24:20 +01:00
|
|
|
|
} else if (strcmp(type, "tree")==0) {
|
2005-12-11 10:58:17 +01:00
|
|
|
|
rsettrees(&r, 2, value);
|
|
|
|
|
} else if (strcmp(type, "grave")==0) {
|
|
|
|
|
int fallen = value-deathcount(&r);
|
|
|
|
|
deathcounts(&r, fallen);
|
|
|
|
|
} else if (strcmp(type, "chaos")==0) {
|
|
|
|
|
int fallen = value-chaoscount(&r);
|
|
|
|
|
chaoscounts(&r, fallen);
|
|
|
|
|
}
|
2005-12-04 15:53:27 +01:00
|
|
|
|
}
|
2005-10-09 23:41:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2004-12-19 17:39:51 +01:00
|
|
|
|
static void
|
|
|
|
|
region_setroad(region& r, int dir, lua_Number size)
|
|
|
|
|
{
|
2005-10-25 14:38:01 +02:00
|
|
|
|
rsetroad(&r, (direction_t)dir, (short)(r.terrain->max_road * size));
|
2004-12-19 17:39:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static lua_Number
|
|
|
|
|
region_getroad(region& r, int dir)
|
|
|
|
|
{
|
|
|
|
|
lua_Number result = rroad(&r, (direction_t)dir);
|
2005-10-25 14:38:01 +02:00
|
|
|
|
return r.terrain->max_road / result;
|
2004-12-19 17:39:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-05-31 12:27:33 +02:00
|
|
|
|
static region *
|
2005-10-25 14:38:01 +02:00
|
|
|
|
region_terraform(short x, short y, const char * tname)
|
2004-05-31 12:27:33 +02:00
|
|
|
|
{
|
2005-10-25 14:38:01 +02:00
|
|
|
|
const terrain_type * terrain = get_terrain(tname);
|
2004-05-31 12:27:33 +02:00
|
|
|
|
region * r = findregion(x, y);
|
2005-10-25 14:38:01 +02:00
|
|
|
|
if (terrain==NULL) {
|
2004-05-31 12:27:33 +02:00
|
|
|
|
if (r!=NULL) {
|
|
|
|
|
if (r->units!=NULL) {
|
|
|
|
|
// TODO: error message
|
2006-05-08 22:28:53 +02:00
|
|
|
|
return r;
|
2004-05-31 12:27:33 +02:00
|
|
|
|
}
|
2005-10-25 14:38:01 +02:00
|
|
|
|
// TODO: region l<>schen
|
|
|
|
|
terraform_region(r, NULL);
|
2004-05-31 12:27:33 +02:00
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
if (r==NULL) r = new_region(x, y);
|
2005-10-25 14:38:01 +02:00
|
|
|
|
terraform_region(r, terrain);
|
2004-05-31 12:27:33 +02:00
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-16 01:29:27 +02:00
|
|
|
|
static region *
|
|
|
|
|
region_next(const region& r, int dir)
|
|
|
|
|
{
|
|
|
|
|
if (dir<0 || dir >=MAXDIRECTIONS) return NULL;
|
|
|
|
|
return r_connect(&r, (direction_t)dir);
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-01 12:48:36 +01:00
|
|
|
|
static void
|
|
|
|
|
region_adddirection(region& r, region &rt, const char * name, const char * info)
|
|
|
|
|
{
|
|
|
|
|
create_special_direction(&r, &rt, -1, info, name);
|
|
|
|
|
spec_direction * sd = special_direction(&r, &rt);
|
|
|
|
|
sd->active = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-01 16:16:41 +01:00
|
|
|
|
static void
|
|
|
|
|
region_remove(region& r)
|
|
|
|
|
{
|
|
|
|
|
region ** rp = ®ions;
|
|
|
|
|
while (*rp) {
|
|
|
|
|
if (*rp==&r) {
|
2005-01-01 18:14:51 +01:00
|
|
|
|
while (r.units) {
|
2006-08-12 21:15:16 +02:00
|
|
|
|
unit * u = r.units;
|
|
|
|
|
destroy_unit(u);
|
|
|
|
|
remove_unit(u);
|
2005-01-01 16:16:41 +01:00
|
|
|
|
}
|
|
|
|
|
*rp = r.next;
|
|
|
|
|
#ifdef FAST_CONNECT
|
|
|
|
|
direction_t dir;
|
|
|
|
|
for (dir=0;dir!=MAXDIRECTIONS;++dir) {
|
|
|
|
|
region * rn = r.connect[dir];
|
|
|
|
|
if (rn) {
|
|
|
|
|
direction_t reldir = reldirection(rn, &r);
|
|
|
|
|
r.connect[dir] = NULL;
|
|
|
|
|
rn->connect[reldir] = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2005-01-03 23:09:33 +01:00
|
|
|
|
runhash(&r);
|
2005-01-01 16:16:41 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
rp = &(*rp)->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-03 23:09:33 +01:00
|
|
|
|
void
|
2005-06-10 00:10:35 +02:00
|
|
|
|
region_move(region& r, short x, short y)
|
2005-01-03 23:09:33 +01:00
|
|
|
|
{
|
2005-01-04 01:12:23 +01:00
|
|
|
|
if (findregion(x,y)) {
|
|
|
|
|
log_error(("Bei %d, %d gibt es schon eine Region.\n", x, y));
|
|
|
|
|
return;
|
|
|
|
|
}
|
2005-01-03 23:09:33 +01:00
|
|
|
|
#ifdef FAST_CONNECT
|
|
|
|
|
direction_t dir;
|
|
|
|
|
for (dir=0;dir!=MAXDIRECTIONS;++dir) {
|
|
|
|
|
region * rn = r.connect[dir];
|
|
|
|
|
if (rn!=NULL) {
|
|
|
|
|
direction_t reldir = reldirection(rn, &r);
|
|
|
|
|
rn->connect[reldir] = NULL;
|
|
|
|
|
}
|
|
|
|
|
rn = findregion(x+delta_x[dir], y+delta_y[dir]);
|
|
|
|
|
if (rn!=NULL) {
|
2005-01-14 18:47:51 +01:00
|
|
|
|
direction_t reldir = (direction_t)((dir + 3) % MAXDIRECTIONS);
|
2005-01-03 23:09:33 +01:00
|
|
|
|
rn->connect[reldir] = &r;
|
|
|
|
|
}
|
|
|
|
|
r.connect[dir] = rn;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
runhash(&r);
|
|
|
|
|
r.x = x;
|
|
|
|
|
r.y = y;
|
|
|
|
|
rhash(&r);
|
|
|
|
|
}
|
|
|
|
|
|
2005-12-11 10:58:17 +01:00
|
|
|
|
static eressea::list<std::string, item *, eressea::bind_items>
|
|
|
|
|
region_items(const region& r) {
|
|
|
|
|
if (r.land) {
|
|
|
|
|
return eressea::list<std::string, item *, eressea::bind_items>(r.land->items);
|
|
|
|
|
} else {
|
|
|
|
|
return eressea::list<std::string, item *, eressea::bind_items>(NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
region_additem(region& r, const char * iname, int number)
|
|
|
|
|
{
|
2007-01-01 13:06:29 +01:00
|
|
|
|
if (iname!=NULL) {
|
|
|
|
|
const item_type * itype = it_find(iname);
|
|
|
|
|
if (itype!=NULL && r.land) {
|
|
|
|
|
item * i = i_change(&r.land->items, itype, number);
|
|
|
|
|
return i?i->number:0;
|
|
|
|
|
} // if (itype!=NULL)
|
|
|
|
|
}
|
2005-12-11 10:58:17 +01:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2007-01-13 22:29:57 +01:00
|
|
|
|
static bool
|
|
|
|
|
region_getkey(region& r, const char * name)
|
|
|
|
|
{
|
|
|
|
|
int flag = atoi36(name);
|
|
|
|
|
attrib * a = find_key(r.attribs, flag);
|
|
|
|
|
return (a!=NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
region_setkey(region& r, const char * name, bool value)
|
|
|
|
|
{
|
|
|
|
|
int flag = atoi36(name);
|
|
|
|
|
attrib * a = find_key(r.attribs, flag);
|
|
|
|
|
if (a==NULL && value) {
|
|
|
|
|
add_key(&r.attribs, flag);
|
|
|
|
|
} else if (a!=NULL && !value) {
|
|
|
|
|
a_remove(&r.attribs, a);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-11-10 00:36:11 +01:00
|
|
|
|
void
|
2006-05-08 22:28:53 +02:00
|
|
|
|
bind_region(lua_State * L)
|
2003-11-10 00:36:11 +01:00
|
|
|
|
{
|
|
|
|
|
module(L)[
|
2003-12-14 11:02:29 +01:00
|
|
|
|
def("regions", &get_regions, return_stl_iterator),
|
2003-11-10 00:36:11 +01:00
|
|
|
|
def("get_region", &findregion),
|
2005-10-25 14:38:01 +02:00
|
|
|
|
def("terraform", ®ion_terraform),
|
2006-07-25 01:18:38 +02:00
|
|
|
|
def("distance", &distance),
|
2003-11-10 00:36:11 +01:00
|
|
|
|
|
|
|
|
|
class_<struct region>("region")
|
2004-04-11 18:16:26 +02:00
|
|
|
|
.def(tostring(self))
|
|
|
|
|
.def(self == region())
|
2003-11-10 00:36:11 +01:00
|
|
|
|
.property("name", ®ion_getname, ®ion_setname)
|
|
|
|
|
.property("info", ®ion_getinfo, ®ion_setinfo)
|
2005-11-20 13:58:59 +01:00
|
|
|
|
.property("owner", &lua_region_getowner, &lua_region_setowner)
|
2006-05-08 22:28:53 +02:00
|
|
|
|
.property("herbtype", ®ion_getherbtype, ®ion_setherbtype)
|
2003-12-14 20:17:59 +01:00
|
|
|
|
.property("terrain", ®ion_getterrain)
|
2004-04-11 02:45:12 +02:00
|
|
|
|
.def("add_notice", ®ion_addnotice)
|
2005-01-01 12:48:36 +01:00
|
|
|
|
.def("add_direction", ®ion_adddirection)
|
2004-12-19 17:39:51 +01:00
|
|
|
|
|
2007-01-13 22:29:57 +01:00
|
|
|
|
.def("get_key", ®ion_getkey)
|
|
|
|
|
.def("set_key", ®ion_setkey)
|
|
|
|
|
|
2004-05-30 14:14:46 +02:00
|
|
|
|
.def("get_flag", ®ion_getflag)
|
|
|
|
|
.def("set_flag", ®ion_setflag)
|
2004-12-19 17:39:51 +01:00
|
|
|
|
|
2005-01-01 16:16:41 +01:00
|
|
|
|
.def("remove", ®ion_remove)
|
2005-01-03 23:09:33 +01:00
|
|
|
|
.def("move", ®ion_move)
|
2005-01-01 16:16:41 +01:00
|
|
|
|
|
2004-12-19 17:39:51 +01:00
|
|
|
|
.def("get_road", ®ion_getroad)
|
|
|
|
|
.def("set_road", ®ion_setroad)
|
|
|
|
|
|
2004-06-16 01:29:27 +02:00
|
|
|
|
.def("next", ®ion_next)
|
2005-01-13 13:42:36 +01:00
|
|
|
|
.def("get_resource", ®ion_getresource)
|
2005-10-09 23:41:04 +02:00
|
|
|
|
.def("set_resource", ®ion_setresource)
|
2003-11-10 00:36:11 +01:00
|
|
|
|
.def_readonly("x", ®ion::x)
|
|
|
|
|
.def_readonly("y", ®ion::y)
|
|
|
|
|
.def_readwrite("age", ®ion::age)
|
2005-12-11 10:58:17 +01:00
|
|
|
|
.def("add_item", ®ion_additem)
|
|
|
|
|
.property("items", ®ion_items, return_stl_iterator)
|
2004-04-11 01:21:58 +02:00
|
|
|
|
.property("plane_id", ®ion_plane)
|
2003-11-10 00:36:11 +01:00
|
|
|
|
.property("units", ®ion_units, return_stl_iterator)
|
|
|
|
|
.property("buildings", ®ion_buildings, return_stl_iterator)
|
|
|
|
|
.property("ships", ®ion_ships, return_stl_iterator)
|
2005-11-26 16:28:11 +01:00
|
|
|
|
.property("objects", &eressea::get_objects<region>)
|
2003-11-10 00:36:11 +01:00
|
|
|
|
];
|
|
|
|
|
}
|