pybrood icon indicating copy to clipboard operation
pybrood copied to clipboard

getLastCommand wrapped?

Open RikonYu opened this issue 7 years ago • 3 comments

Is unit::getLastCommand() wrapping in pybrood? It seems that I cant find this in pybrood document. Thanks.

RikonYu avatar May 30 '18 16:05 RikonYu

UnitCommand class isn't wrapped yet, so that's why getLastCommand is missing.

neumond avatar Jun 03 '18 02:06 neumond

I added this into inner.cpp py::class_<BWAPI::UnitCommand>(m, "UnitCommand") .def("getType",&UnitCommand::getType) .def("getUnit",&UnitCommand::getUnit) .def("getTarget",&UnitCommand::getTarget) .def("getTargetPosition",&UnitCommand::getTargetPosition) .def("getTargetTilePosition",&UnitCommand::getTargetTilePosition) .def("getUnitType",&UnitCommand::getUnitType) .def("getTechType",&UnitCommand::getTechType) .def("getUpgradeType",&UnitCommand::getUpgradeType) .def("getSlot",&UnitCommand::getSlot) .def("isQueued",&UnitCommand::isQueued);

then add .def("getLastCommand",&UnitInterface::getLastCommand) to Unit, at line 937. this is sufficient for me for now.

RikonYu avatar Jun 03 '18 23:06 RikonYu

Looks good. I need to find some time to add UnitCommand at code generation stage, verify with your code (since you've tested this) and release new version. Thanks.

neumond avatar Jun 04 '18 00:06 neumond