#include #include #include // kernel includes #include #include #include #include #include // lua includes #include #include #include using namespace luabind; static faction * add_faction(const char * email, const char * passwd, const char * racename, const char * lang) { const race * frace = findrace(racename, default_locale); locale * loc = find_locale(lang); faction * f = addfaction(email, passwd, frace, loc, 0); return f; } static unit * add_unit(faction * f, region * r) { if (f->units==NULL) return addplayer(r, f); return createunit(r, f, 0, f->race); } static alliance * add_alliance(int id, const char * name) { return makealliance(id, name); } void bind_eressea(lua_State * L) { module(L)[ def("add_unit", &add_unit), def("add_faction", &add_faction), def("add_alliance", &add_alliance) ]; }