* 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
| 19 | * |
| 20 | */ |
| 21 | class UnitTarget |
| 22 | { |
| 23 | public : |
| 24 | UnitTarget(); |
| 25 | |
| 26 | /// Constructor, takes BWAPI unit pointer, and decodes it to bw index type. |
| 27 | UnitTarget(const BWAPI::Unit target); |
| 28 | UnitTarget(const BW::CUnit* target); |
| 29 | u16 getTarget() const; |
| 30 | private : |
| 31 | u16 targetID = 0; /// Unit index pointer stored in the way bw understands it |
| 32 | }; |
| 33 | |
| 34 | static_assert(sizeof(UnitTarget) == 2, "UnitTarget is expected to be POD 2 bytes."); |
| 35 | }; |
no outgoing calls
no test coverage detected