BWAPI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
BW::UnitTarget Class Reference

#include <UnitTarget.h>

List of all members.

Public Member Functions

 UnitTarget ()
 UnitTarget (BWAPI::UnitImpl *target)
 UnitTarget (BW::Unit *target)
u16 getTarget () const

Detailed Description

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)


Constructor & Destructor Documentation

Default contructor, sets x and y to 0.

Constructor, takes BWAPI unit pointer, and decodes it to bw index type.


Member Function Documentation

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines