lua: faction.locale ist jetzt writeable.

This commit is contained in:
Enno Rehling 2005-02-13 08:04:51 +00:00
parent fc7e4493f1
commit 03548f12b4
1 changed files with 8 additions and 2 deletions

View File

@ -71,11 +71,17 @@ faction_getalliance(const faction& f)
} }
const char * const char *
faction_locale(const faction& f) faction_getlocale(const faction& f)
{ {
return locale_name(f.locale); return locale_name(f.locale);
} }
void
faction_setlocale(faction& f, const char * name)
{
f.locale = find_locale(name);
}
static std::ostream& static std::ostream&
operator<<(std::ostream& stream, const faction& f) operator<<(std::ostream& stream, const faction& f)
{ {
@ -209,7 +215,7 @@ bind_faction(lua_State * L)
.def_readwrite("lastturn", &faction::lastorders) .def_readwrite("lastturn", &faction::lastorders)
.def("add_item", &faction_additem) .def("add_item", &faction_additem)
.def("add_notice", &faction_addnotice) .def("add_notice", &faction_addnotice)
.property("locale", &faction_locale) .property("locale", &faction_getlocale, &faction_setlocale)
.property("units", &faction_units, return_stl_iterator) .property("units", &faction_units, return_stl_iterator)
.property("alliance", &faction_getalliance, &faction_setalliance) .property("alliance", &faction_getalliance, &faction_setalliance)
.property("race", &faction_getrace, &faction_setrace) .property("race", &faction_getrace, &faction_setrace)