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) ...@@ -54,8 +54,8 @@ PYBIND11_MODULE(library, m)
.def(py::init()) .def(py::init())
// TODO: The following 3 are CamelCased, but if the name is changed // TODO: The following 3 are CamelCased, but if the name is changed
// the name used for inheritance in Pyhon stays the same. Weird. // the name used for inheritance in Pyhon stays the same. Weird.
.def("OnGameStart", &IDABot::OnGameStart) .def("on_game_start", &IDABot::OnGameStart)
.def("OnStep", &IDABot::OnStep) .def("on_step", &IDABot::OnStep)
.def("get_all_units", &IDABot::GetAllUnits) .def("get_all_units", &IDABot::GetAllUnits)
.def("get_my_units", &IDABot::GetMyUnits) .def("get_my_units", &IDABot::GetMyUnits)
.def("get_player_race", &IDABot::GetPlayerRace) .def("get_player_race", &IDABot::GetPlayerRace)
......
...@@ -29,17 +29,19 @@ public: ...@@ -29,17 +29,19 @@ public:
using IDABot::IDABot; using IDABot::IDABot;
void OnGameStart() override void OnGameStart() override
{ {
PYBIND11_OVERLOAD( PYBIND11_OVERLOAD_NAME(
void, void,
IDABot, IDABot,
"on_game_start",
OnGameStart OnGameStart
); );
} }
void OnStep() override void OnStep() override
{ {
PYBIND11_OVERLOAD( PYBIND11_OVERLOAD_NAME(
void, void,
IDABot, IDABot,
"on_step",
OnStep 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