BWAPI
|
#include <UnitTarget.h>
Public Member Functions | |
UnitTarget () | |
UnitTarget (BWAPI::UnitImpl *target) | |
UnitTarget (BW::Unit *target) | |
u16 | getTarget () const |
Representation of pointer to unit in bw structure that uses index (not pointer). When pointer to another unit is present in bw structure, it uses two ways to do it 1) Pointer to bw memory where is the unit stored (in UnitNodeTable) This is used for example in Unit.next, this representation takes 4 bytes. 2) unitIndes in the UnitNodeTable, this is used for example in Orders, the motivation probably was to save network data capacity, as only 2 bytes are needed to store the index. But for some unkown reason, value there is unit index + 1 << 11 (1 in the binary code on 11th place)
Default contructor, sets x and y to 0.
BW::UnitTarget::UnitTarget | ( | BWAPI::UnitImpl * | target | ) |
Constructor, takes BWAPI unit pointer, and decodes it to bw index type.
BW::UnitTarget::UnitTarget | ( | BW::Unit * | target | ) |
u16 BW::UnitTarget::getTarget | ( | ) | const |