From 8b14642bbb448a4cd9d4abe35bc71a7d1f310aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <davbe125@student.liu.se> Date: Fri, 29 Jun 2018 09:05:28 +0200 Subject: [PATCH] Add the last properties of IDABot to the Python-API --- python-api-src/library.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python-api-src/library.cpp b/python-api-src/library.cpp index bed5409..8f3bfce 100644 --- a/python-api-src/library.cpp +++ b/python-api-src/library.cpp @@ -54,13 +54,21 @@ PYBIND11_MODULE(library, m) // IDABot is a specialization of Agent py::class_<IDABot, PyIDABot, sc2::Agent>(m, "IDABot") .def(py::init()) + // TODO: The following 3 are CamelCased, but if the name is changed + // the name used for inheritance in Pyhon stays the same. Weird. .def("OnGameStart", &IDABot::OnGameStart) .def("OnStep", &IDABot::OnStep) .def("OnStep_UpdateIDABot", &IDABot::OnStep_UpdateIDABot) .def("get_all_units", &IDABot::GetAllUnits) .def("get_my_units", &IDABot::GetMyUnits) + .def("get_player_race", &IDABot::GetPlayerRace) + .def_property_readonly("base_location_manager", &IDABot::Bases) .def_property_readonly("tech_tree", &IDABot::TechTree) - .def_property_readonly("base_manager", &IDABot::Bases); + .def_property_readonly("start_location", &IDABot::GetStartLocation) + .def_property_readonly("minerals", &IDABot::GetMinerals) + .def_property_readonly("current_supply", &IDABot::GetCurrentSupply) + .def_property_readonly("max_supply", &IDABot::GetMaxSupply) + .def_property_readonly("gas", &IDABot::GetGas); py::class_<sc2::PlayerSetup>(m, "PlayerSetup"); -- GitLab