#include #include #include "list.h" // kernel includes #include #include #include // lua includes #include #include #include #include using namespace luabind; class factionlist_iterator { public: static faction_list * next(faction_list * node) { return node->next; } static faction * value(faction_list * node) { return node->data; } }; static eressea::list alliance_factions(const alliance& al) { return eressea::list(al.members); } static alliance * add_alliance(int id, const char * name) { return makealliance(id, name); } static eressea::list get_alliances(void) { return eressea::list(alliances); } void bind_alliance(lua_State * L) { module(L)[ def("alliances", &get_alliances, return_stl_iterator), def("get_alliance", &findalliance), def("add_alliance", &add_alliance), def("victorycondition", &victorycondition), class_("alliance") .def_readonly("name", &alliance::name) .def_readonly("id", &alliance::id) .property("factions", &alliance_factions, return_stl_iterator) ]; }