Skip to content
Snippets Groups Projects
Commit 054598a2 authored by Ludvig Fors's avatar Ludvig Fors
Browse files

Added chat functionallity making the bot able to send messages to the game...

Added chat functionallity making the bot able to send messages to the game chat for everyone to see. Used by calling self.send_chat(<message>).
parent 863026a8
No related branches found
No related tags found
1 merge request!2Added chat functionallity making the bot able to send messages to the game...
......@@ -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)
......
......@@ -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);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment