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

Use snake case for methods of IDABot

parent 6316ecff
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,8 @@ PYBIND11_MODULE(library, m)
.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("on_game_start", &IDABot::OnGameStart)
.def("on_step", &IDABot::OnStep)
.def("get_all_units", &IDABot::GetAllUnits)
.def("get_my_units", &IDABot::GetMyUnits)
.def("get_player_race", &IDABot::GetPlayerRace)
......
......@@ -29,17 +29,19 @@ public:
using IDABot::IDABot;
void OnGameStart() override
{
PYBIND11_OVERLOAD(
PYBIND11_OVERLOAD_NAME(
void,
IDABot,
"on_game_start",
OnGameStart
);
}
void OnStep() override
{
PYBIND11_OVERLOAD(
PYBIND11_OVERLOAD_NAME(
void,
IDABot,
"on_step",
OnStep
);
}
......
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