From: <geo...@us...> - 2015-03-02 18:32:37
|
Revision: 7993 http://sourceforge.net/p/freeorion/code/7993 Author: geoffthemedio Date: 2015-03-02 18:32:30 +0000 (Mon, 02 Mar 2015) Log Message: ----------- Added some meter type containers to Python API, hopefully fixing some gamestate getters. Modified Paths: -------------- trunk/FreeOrion/python/PythonUniverseWrapper.cpp Modified: trunk/FreeOrion/python/PythonUniverseWrapper.cpp =================================================================== --- trunk/FreeOrion/python/PythonUniverseWrapper.cpp 2015-03-01 21:18:26 UTC (rev 7992) +++ trunk/FreeOrion/python/PythonUniverseWrapper.cpp 2015-03-02 18:32:30 UTC (rev 7993) @@ -254,7 +254,19 @@ class_<std::vector<ShipSlotType> >("ShipSlotVec") .def(boost::python::vector_indexing_suite<std::vector<ShipSlotType>, true>()) ; + class_<std::map<MeterType, Meter> >("MeterTypeMeterMap") + .def(boost::python::map_indexing_suite<std::map<MeterType, Meter>, true>()) + ; + // typedef std::map<std::pair<MeterType, std::string>, Meter> PartMeterMap; + class_<std::pair<MeterType, std::string> >("MeterTypeStringPair") + .add_property("meterType", &std::pair<MeterType, std::string>::first) + .add_property("string", &std::pair<MeterType, std::string>::second) + ; + class_<Ship::PartMeterMap>("MeterTypeStringPairMeterMap") + .def(boost::python::map_indexing_suite<Ship::PartMeterMap, true>()) + ; + //////////////////// // Universe // //////////////////// |