mirror of https://github.com/dnomd343/klotski.git
Dnomd343
3 weeks ago
4 changed files with 36 additions and 42 deletions
@ -1,13 +1,16 @@ |
|||||
#include "binder.h" |
#include "binder.h" |
||||
|
|
||||
void bind_cases(const py::module_ &m) { |
void bind_cases(const py::module_ &mod) { |
||||
py::class_<PyCases>(m, "Cases") |
py::class_<PyCases>(mod, "Cases") |
||||
.def(py::self == py::self) |
.def(py::self == py::self) |
||||
.def("__len__", &PyCases::size) |
.def("__len__", &PyCases::size) |
||||
.def("__repr__", &PyCases::repr) |
.def("__repr__", &PyCases::repr) |
||||
.def("__getitem__", &PyCases::at) |
.def("__getitem__", &PyCases::at) |
||||
.def("__iter__", &PyCases::codes, py::keep_alive<0, 1>()); |
.def("__iter__", &PyCases::iter, py::keep_alive<0, 1>()) |
||||
|
.def_property_readonly_static("all_cases", [](const py::object&) { |
||||
|
return PyCases::all_cases(); |
||||
|
}); |
||||
|
|
||||
py::class_<PyCasesIter>(m, "CasesIter") |
py::class_<PyCasesIter>(mod, "CasesIter") |
||||
.def("__next__", &PyCasesIter::next); |
.def("__next__", &PyCasesIter::next); |
||||
} |
} |
||||
|
Loading…
Reference in new issue