MCPcopy Create free account
hub / github.com/bwapi/bwapi / UnitTarget

Class UnitTarget

bwapi/BWAPI/Source/BW/UnitTarget.h:21–32  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

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};

Callers 3

updateInternalDataMethod · 0.85
SelectAddMethod · 0.85
SelectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected