Skip to content
Snippets Groups Projects
Commit 7fb62b83 authored by David Bergström's avatar David Bergström
Browse files

Merge branch 'master' into 'master'

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

See merge request starcraft-ai-course/pycommandcenter!2
parents 582c0b77 25ee6cf6
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,10 @@ IDABot
Returns the players race, useful if you play Race.Random
.. method:: IDABot.send_chat(self, message)
Sends the string 'message' to the game chat
Attributes:
.. autoattribute:: minerals
......
......@@ -75,6 +75,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.
Please register or to comment