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

#include <Unit.h>

Collaboration diagram for BW::Unit:
Collaboration graph
[legend]

List of all members.

Public Member Functions

BWAPI::UnitType type () const
bool movementFlag (u8 flags) const
bool statusFlag (u32 flags) const

Public Attributes

BW::Unitprev
BW::Unitnext
s32 hitPoints
BW::Spritesprite
BW::Position moveToPos
BW::UnitmoveToUnit
BW::Position nextMovementWaypoint
BW::Position nextTargetWaypoint
u8 movementFlags
u8 currentDirection1
u8 flingyTurnRadius
u8 velocityDirection1
u16 flingyID
u8 _unknown_0x026
u8 flingyMovementType
BW::Position position
POINT halt
u32 flingyTopSpeed
s32 current_speed1
s32 current_speed2
POINT current_speed
u16 flingyAcceleration
u8 currentDirection2
u8 velocityDirection2
u8 playerID
u8 orderID
u8 orderState
u8 orderSignal
u16 orderUnitType
u16 _unused_0x052
u8 mainOrderTimer
u8 groundWeaponCooldown
u8 airWeaponCooldown
u8 spellCooldown
BW::Position orderTargetPos
BW::UnitorderTargetUnit
u32 shieldPoints
u16 unitType
u16 _padding_0x066
BW::UnitpreviousPlayerUnit
BW::UnitnextPlayerUnit
BW::UnitsubUnit
BW::OrderorderQueueHead
BW::OrderorderQueueTail
BW::UnitAutoTargetUnit
BW::UnitconnectedUnit
u8 orderQueueCount
u8 orderQueueTimer
u8 _unknown_0x086
u8 attackNotifyTimer
u16 displayedUnitID
u8 lastEventTimer
u8 lastEventColor
u16 _unused_0x08C
u8 rankIncrease
u8 killCount
u8 lastAttackingPlayer
u8 secondaryOrderTimer
u8 _unknown_0x091
u8 userActionFlags
u16 currentButtonSet
u8 cloaked
u8 movementState
u16 buildQueue [5]
u16 energy
u8 buildQueueSlot
u8 targetOrderSpecial
u8 secondaryOrderID
u8 buildingOverlayState
u16 hpGainDuringRepair
u16 _unknown_0x0AA
u16 remainingBuildTime
u16 previousHP
u16 loadedUnitIndex [8]
union {
   struct {
      u8   spiderMineCount
   }   vulture
   struct {
      BW::Unit *   inHangerChild
      BW::Unit *   outHangerChild
      u8   inHangerCount
      u8   outHangerCount
   }   carrier
   struct {
      BW::Unit *   parent
      BW::Unit *   prev
      BW::Unit *   next
      u8   inHanger
   }   interceptor
   struct {
      u32   _unknown_00
      u32   _unknown_04
      u32   flagSpawnFrame
   }   beacon
   struct {
      BW::Unit *   addon
      u16   addonBuildType
      u16   upgradeResearchTime
      u8   techType
      u8   upgradeType
      u8   larvaTimer
      u8   landingTimer
      u8   creepTimer
      u8   upgradeLevel
      u16   _padding_0E
      union {
         struct {
            u16   resourceCount
            u8   resourceIscript
            u8   gatherQueueCount
            BW::Unit *   nextGatherer
            u8   resourceGroup
            u8   resourceBelongsToAI
         }   resource
         struct {
            BW::Unit *   exit
         }   nydus
         struct {
            BW::Sprite *   nukeDot
         }   ghost
         struct {
            BW::Sprite *   pylonAura
         }   pylon
         struct {
            BW::Unit *   nuke
            u32   hasNuke
         }   silo
         struct {
            u16   harvestValue1
            u16   harvestValue2
            u16   _unknown_14
            u16   harvestValue3
         }   hatchery
         struct {
            POINTS   origin
         }   powerup
      } 
   }   building
   struct {
      BW::Unit *   powerup
      POINTS   targetResource
      BW::Unit *   targetResourceUnit
      u16   repairResourceLossTimer
      u8   isCarryingSomething
      u8   resourceCarryCount
      BW::Unit *   harvestTarget
      BW::Unit *   prevHarvestUnit
      BW::Unit *   nextHarvestUnit
   }   worker
}; 
u32 statusFlags
u8 resourceType
u8 wireframeRandomizer
u8 secondaryOrderState
u8 recentOrderTimer
s32 visibilityStatus
u16 _unknown_0x0E8
u16 _unknown_0x0EA
BW::UnitcurrentBuildUnit
BW::UnitpreviousBurrowedUnit
BW::UnitnextBurrowedUnit
union {
   struct {
      POINTS   position
      BW::Unit *   unit
   }   rally
   struct {
      BW::Unit *   prevPsiProvider
      BW::Unit *   nextPsiProvider
   }   pylon
}; 
BW::Pathpath
u8 pathingCollisionInterval
u8 pathingFlags
u8 _unused_0x106
u8 isBeingHealed
rect contourBounds
struct {
   u16   removeTimer
   u16   defenseMatrixDamage
   u8   defenseMatrixTimer
   u8   stimTimer
   u8   ensnareTimer
   u8   lockdownTimer
   u8   irradiateTimer
   u8   stasisTimer
   u8   plagueTimer
   u8   isUnderStorm
   BW::Unit *   irradiatedBy
   u8   irradiatePlayerID
   u8   parasiteFlags
   u8   cycleCounter
   u8   isBlind
   u8   maelstromTimer
   u8   _unused_0x125
   u8   acidSporeCount
   u8   acidSporeTime [9]
status
u16 bulletBehaviour3by3AttackSequence
u16 _padding_0x132
void * CAIControl
u16 airStrength
u16 groundStrength
u32 unitFinderIndexLeft
u32 unitFinderIndexRight
u32 unitFinderIndexTop
u32 unitFinderIndexBottom
u8 _repulseUnknown
u8 repulseAngle
u8 driftPosX
u8 driftPosY

Detailed Description

Direct data mapping of the broodwar unit structure. Most of the information here is derived from http://farty1billion.dyndns.org/EUDDB/?pg=ref&a=unitnode Values marked

Todo:

Unknown are labeled as the EUDDB has them labeled, but the true meaning is not understood. Values marked

Verify have known meanings, but are not confirmed.


Member Function Documentation

bool BW::Unit::movementFlag ( u8  flags) const

Here is the caller graph for this function:

bool BW::Unit::statusFlag ( u32  flags) const

Here is the caller graph for this function:

Here is the caller graph for this function:


Member Data Documentation

union { ... }
union { ... }
Todo:
Unknown

verified

struct { ... } BW::Unit::beacon
struct { ... } BW::Unit::building

Queue of units to build. Note that it doesn't begin with index 0, but with buildQueueSlot index.

Index of active unit in buildQueue.

struct { ... } BW::Unit::carrier

Addon is connected to building (addon has connected building, but not in other direction

The current direction the unit is facing

(mapsizex/1.5 max)

(mapsizex/1.5 max)

Energy Points

struct { ... } BW::Unit::ghost

connected nydius canal

verified

Todo:
Unknown
struct { ... } BW::Unit::hatchery

Hit points of unit, note that the displayed value in broodwar is ceil(healthPoints/256)

Todo:
Verify
struct { ... } BW::Unit::interceptor
Todo:
Verify
Todo:
Verify

Killcount

Flags specifying movement type - defined in BW::MovementFlags.

Pointer to next unit in the unit linked list, we use it to iterate units.

See also:
BW::BWXFN_UnitNodeTable_FirstElement

The next way point in the path the unit is following to get to its destination. Equal to moveToPos for air units since they don't need to navigate around buildings or other units.

The desired position

struct { ... } BW::Unit::nydus

When the unit is resource container

Specification of type of order currently given.

Todo:
Verify

Additional order info (mostly unknown, wander property investigated so far)

Specification of owner of this unit.

Current position of the unit

struct { ... } BW::Unit::powerup
struct { ... } BW::Unit::pylon
struct { ... } BW::Unit::pylon

If the unit is rally type

struct { ... } BW::Unit::rally

Adds this value to the unit's base rank

Remaining bulding time; This is also the timer for powerups (flags) to return to their original location.

Verified for Hallucination, DWeb, Scarab, DSwarm, and Broodling; does not apply to scanner sweep

struct { ... } BW::Unit::resource

Resource being held by worker: 1 = gas, 2 = ore

(Build addon verified)

Todo:
verify (Cloak, Build, ExpandCreep suggested by EUDDB)

Bw shows this value/256

struct { ... } BW::Unit::silo
struct { ... } BW::Unit::status

A byte used to determine the target ID for the unit

Specifies the type of unit.

This usually only differs from the currentDirection field for units that can accelerate and travel in a different direction than they are facing. For example Mutalisks can change the direction they are facing faster than then can change the direction they are moving.

struct { ... } BW::Unit::vulture
struct { ... } BW::Unit::worker

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