diff --git a/python-api-src/library.cpp b/python-api-src/library.cpp index dd1bc0cfd0cd945da04754358c7214bfcd48b487..bfdb607e9a57e36cc81e077afd9ef44b088957a0 100644 --- a/python-api-src/library.cpp +++ b/python-api-src/library.cpp @@ -74,6 +74,7 @@ PYBIND11_MODULE(library, m) .def(py::init()) .def("on_game_start", &IDABot::OnGameStart) .def("on_step", &IDABot::OnStep) + .def("send_chat", &IDABot::SendChat, "Send a message to the game chat", "message"_a) .def("get_all_units", &IDABot::GetAllUnits, "Returns a list of all units") .def("get_my_units", &IDABot::GetMyUnits, "Returns a list of all units beloning to the player") .def("get_player_race", &IDABot::GetPlayerRace) diff --git a/src/IDABot.cpp b/src/IDABot.cpp index c12fe5ab76ceddd8b69575208806c514718c3265..9c182ae62d7b09a6b6f93bb26f15b2ecf16b2c8c 100644 --- a/src/IDABot.cpp +++ b/src/IDABot.cpp @@ -199,6 +199,12 @@ BuildingPlacer & IDABot::GetBuildingPlacer() return m_buildingPlacer; } + +void IDABot::SendChat(const std::string & message) +{ + Actions()->SendChat(message); +} + const TypeData & IDABot::Data(const UnitType & type) const { return m_techTree.getData(type); diff --git a/src/IDABot.h b/src/IDABot.h index eca954f01a1857bf31747ae128a239b86dc19e88..ba86ce6c40b6ff6e3eb0fbd8af5e52ffbfe6fb18 100644 --- a/src/IDABot.h +++ b/src/IDABot.h @@ -46,6 +46,8 @@ public: CCPosition GetStartLocation() const; BuildingPlacer & GetBuildingPlacer(); + void SendChat(const std::string & message); + int GetCurrentFrame() const; int GetMinerals() const; int GetCurrentSupply() const;