diff --git a/src/botris/_core/constants.cpp b/src/botris/_core/constants.cpp index 6488a33..f322d3c 100644 --- a/src/botris/_core/constants.cpp +++ b/src/botris/_core/constants.cpp @@ -7,21 +7,21 @@ namespace nb = nanobind; using namespace nb::literals; void bind_constants(nb::module_ &m) { - nb::module_ constants = m.def_submodule("constants", "Group of constants and enums"); + nb::module_ constants_module = m.def_submodule("constants", "Group of constants and enums"); - nb::enum_(constants, "spinType") + nb::enum_(constants_module, "spinType") .value("null", spinType::null) .value("mini", spinType::mini) .value("normal", spinType::normal); - nb::enum_(constants, "RotationDirection") + nb::enum_(constants_module, "RotationDirection") .value("North", RotationDirection::North) .value("East", RotationDirection::East) .value("South", RotationDirection::South) .value("West", RotationDirection::West) .value("RotationDirections_N", RotationDirection::RotationDirections_N); - nb::enum_(constants, "ColorType") + nb::enum_(constants_module, "ColorType") .value("S", ColorType::S) .value("Z", ColorType::Z) .value("J", ColorType::J) @@ -34,7 +34,7 @@ void bind_constants(nb::module_ &m) { .value("Garbage", ColorType::Garbage) .value("ColorTypes_N", ColorType::ColorTypes_N); - nb::enum_(constants, "PieceType") + nb::enum_(constants_module, "PieceType") .value("S", PieceType::S) .value("Z", PieceType::Z) .value("J", PieceType::J) @@ -45,28 +45,28 @@ void bind_constants(nb::module_ &m) { .value("Empty", PieceType::Empty) .value("PieceTypes_N", PieceType::PieceTypes_N); - nb::enum_(constants, "TurnDirection") + nb::enum_(constants_module, "TurnDirection") .value("Left", TurnDirection::Left) .value("Right", TurnDirection::Right); - nb::enum_(constants, "Movement") + nb::enum_(constants_module, "Movement") .value("Left", Movement::Left) .value("Right", Movement::Right) .value("RotateClockwise", Movement::RotateClockwise) .value("RotateCounterClockwise", Movement::RotateCounterClockwise) .value("SonicDrop", Movement::SonicDrop); - nb::class_(constants, "Coord") + nb::class_(constants_module, "Coord") .def(nb::init<>()) .def(nb::init(), "x"_a, "y"_a) .def_rw("x", &Coord::x) .def_rw("y", &Coord::y); - constants.attr("n_minos") = n_minos; + constants_module.attr("n_minos") = n_minos; - constants.attr("piece_definitions") = piece_definitions; + constants_module.attr("piece_definitions") = piece_definitions; - constants.attr("rot_piece_def") = rot_piece_def; + constants_module.attr("rot_piece_def") = rot_piece_def; - constants.attr("piece_spawn_height") = piece_spawn_height; + constants_module.attr("piece_spawn_height") = piece_spawn_height; } diff --git a/src/botris/_core/movegen.cpp b/src/botris/_core/movegen.cpp index 92c2a0c..ffa742b 100644 --- a/src/botris/_core/movegen.cpp +++ b/src/botris/_core/movegen.cpp @@ -8,12 +8,12 @@ namespace nb = nanobind; using namespace nb::literals; void bind_movegen(nb::module_ &m) { - auto tm = m.def_submodule("traditional_movegen", "Shaktris Traditional Movegen Module"); - auto sm = m.def_submodule("smeared_movegen", "Shaktris Smeared Movegen Module"); + auto traditional_module = m.def_submodule("traditional_movegen", "Shaktris Traditional Movegen Module"); + auto smeared_module = m.def_submodule("smeared_movegen", "Shaktris Smeared Movegen Module"); - tm.def("sky_piece_movegen", &Shaktris::MoveGen::Traditional::sky_piece_movegen, "board"_a, "piece_type"_a) + traditional_module.def("sky_piece_movegen", &Shaktris::MoveGen::Traditional::sky_piece_movegen, "board"_a, "piece_type"_a) .def("convex_movegen", &Shaktris::MoveGen::Traditional::convex_movegen, "board"_a, "piece_type"_a); - sm.def("movegen", &Shaktris::MoveGen::Smeared::movegen, "board"_a, "type"_a) + smeared_module.def("movegen", &Shaktris::MoveGen::Smeared::movegen, "board"_a, "type"_a) .def("god_movegen", &Shaktris::MoveGen::Smeared::god_movegen, "board"_a, "type"_a); }