sc2-gamedata
Classes | Enumerations | Variables
Unit.h File Reference
#include "UnderlyingTypes.h"
#include "GameData.h"
#include "Game.h"
Include dependency graph for Unit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SCardButton
 
struct  SCardLayoutButton
 
struct  SCardLayout
 
struct  SUnitAbilData
 
struct  SUnitBehaviorData
 
struct  SUnitWeaponData
 
struct  SAddedOnData
 
struct  SUnitEquipment
 
struct  SUnitReviveInfo
 
class  CUnit
 Generic. More...
 

Enumerations

enum  EClassIdCUnit { e_classIdCUnit }
 Unit Type. More...
 
enum  ECardButtonType {
  e_cardButtonTypeUndefined, e_cardButtonTypeAbilCmd, e_cardButtonTypePassive, e_cardButtonTypeSelectBuilder,
  e_cardButtonTypeSelectLarva, e_cardButtonTypeSubmenu, e_cardButtonTypeCancelSubmenu, e_cardButtonTypeCancelTargetMode,
  e_cardButtonTypeCancelPlacementMode
}
 Button Type. More...
 
enum  EUnitFlag {
  e_unitFlagBounce, e_unitFlagTurnable, e_unitFlagMovable, e_unitFlagWorker,
  e_unitFlagCreateVisible, e_unitFlagUnclickable, e_unitFlagUncommandable, e_unitFlagUnhighlightable,
  e_unitFlagUntooltipable, e_unitFlagUnselectable, e_unitFlagUntargetable, e_unitFlagUncursorable,
  e_unitFlagHero, e_unitFlagHiddenCargoUI, e_unitFlagIndividualSubgroups, e_unitFlagNoDraw,
  e_unitFlagPreventReveal, e_unitFlagPreventDefeat, e_unitFlagPreventDestroy, e_unitFlagPenaltyRevealed,
  e_unitFlagUncloakable, e_unitFlagMissile, e_unitFlagUndetectable, e_unitFlagUnradarable,
  e_unitFlagUseLineOfSight, e_unitFlagKillCredit, e_unitFlagTownAlert, e_unitFlagInvulnerable,
  e_unitFlagDestructible, e_unitFlagCloaked, e_unitFlagBuried, e_unitFlagNoScore,
  e_unitFlagIgnoreTerrainZInit, e_unitFlagTurnBeforeMove, e_unitFlagAlwaysThreatens, e_unitFlagNoDeathEvent,
  e_unitFlagNoPortraitTalk, e_unitFlagTownCamera, e_unitFlagAIThreatGround, e_unitFlagAIThreatAir,
  e_unitFlagAILifetime, e_unitFlagAISplash, e_unitFlagAIHighPrioTarget, e_unitFlagAISplitter,
  e_unitFlagAIDefense, e_unitFlagAICaster, e_unitFlagAISupport, e_unitFlagShowResources,
  e_unitFlagArmorDisabledWhileConstructing, e_unitFlagPawnable, e_unitFlagAIFleeDamageDisabled, e_unitFlagAIPressForwardDisabled,
  e_unitFlagAIObservatory, e_unitFlagForceCollisionCheck, e_unitFlagAIChangeling, e_unitFlagShareControl,
  e_unitFlagBuiltOnOptional, e_unitFlagAcquireRally, e_unitFlagAIAllowSuicideOverride, e_unitFlagAIForceTactical,
  e_unitFlagVisionTestCenterOnly, e_unitFlagUnstoppable, e_unitFlagAIPreferBurrow, e_unitFlagClearRallyOnDeath,
  e_unitFlagSelectableWhileDead, e_unitFlagTargetableWhileDead, e_unitFlagIgnoreAttackAlert, e_unitFlagPreferLastAttackTarget,
  e_unitFlagAIResourceBlocker, e_unitFlagArmySelect
}
 Unit Flag. More...
 
enum  EUnitCollide {
  e_unitCollideLand1, e_unitCollideLand2, e_unitCollideLand3, e_unitCollideLand4,
  e_unitCollideLand5, e_unitCollideLand6, e_unitCollideLand7, e_unitCollideLand8,
  e_unitCollideLand9, e_unitCollideLand10, e_unitCollideLand11, e_unitCollideLand12,
  e_unitCollideLand13, e_unitCollideLand14, e_unitCollideLand15, e_unitCollideLand16,
  e_unitCollideAir1, e_unitCollideAir2, e_unitCollideAir3, e_unitCollideAir4,
  e_unitCollideAir5, e_unitCollideAir6, e_unitCollideAir7, e_unitCollideAir8,
  e_unitCollideAir9, e_unitCollideAir10, e_unitCollideAir11, e_unitCollideAir12,
  e_unitCollideAir13, e_unitCollideAir14, e_unitCollideAir15, e_unitCollideAir16
}
 Unit Collide. More...
 
enum  EUnitResponse { e_unitResponseNothing, e_unitResponseFlee, e_unitResponseAcquire, e_unitResponseAcquireNoFlee }
 Unit Response. More...
 
enum  EUnitAttribute {
  e_unitAttributeLight, e_unitAttributeArmored, e_unitAttributeBiological, e_unitAttributeMechanical,
  e_unitAttributeRobotic, e_unitAttributePsionic, e_unitAttributeMassive, e_unitAttributeStructure,
  e_unitAttributeHover, e_unitAttributeHeroic, e_unitAttributeSummoned
}
 Unit Attribute. More...
 
enum  ECmdFlags {
  e_cmdFlagAlternate, e_cmdFlagQueued, e_cmdFlagPreempt, e_cmdFlagSmartClick,
  e_cmdFlagSmartRally, e_cmdFlagSubgroup, e_cmdFlagSetAutoCast, e_cmdFlagSetAutoCastOn
}
 Command Flags. More...
 
enum  EKillDisplay { e_killDisplayDefault, e_killDisplayAlways, e_killDisplayNever }
 Kill Display. More...
 
enum  ERankDisplay { e_rankDisplayDefault, e_rankDisplayAlways, e_rankDisplayNever }
 Rank Display. More...
 
enum  EDeathReveal { e_deathRevealVision, e_deathRevealSnapshot }
 Death Reveal. More...
 
enum  EUnitEffect { e_unitEffectCreate, e_unitEffectBirth, e_unitEffectDeath, e_unitEffectRevive }
 Unit Effect. More...
 

Variables

const int32 e_classIdCUnitCount = 1
 
const int32 e_cardButtonTypeCount = 9
 
const int32 e_unitFlagCount = 70
 
const int32 e_unitCollideCount = 32
 
const int32 e_unitResponseCount = 4
 
const int32 e_unitAttributeCount = 11
 
const int32 e_cmdFlagCount = 8
 
const int32 e_killDisplayCount = 3
 
const int32 e_rankDisplayCount = 3
 
const int32 e_deathRevealCount = 2
 
const int32 e_unitEffectCount = 4
 

Enumeration Type Documentation

◆ ECardButtonType

Button Type.

Remarks
Enum
Enumerator
e_cardButtonTypeUndefined 

Undefined.

e_cardButtonTypeAbilCmd 

Ability Command.

e_cardButtonTypePassive 

Passive.

e_cardButtonTypeSelectBuilder 

Select Builder.

e_cardButtonTypeSelectLarva 

Select Larva.

e_cardButtonTypeSubmenu 

Submenu.

e_cardButtonTypeCancelSubmenu 

Cancel Submenu.

e_cardButtonTypeCancelTargetMode 

Cancel Target.

e_cardButtonTypeCancelPlacementMode 

Cancel Placement.

◆ EClassIdCUnit

Unit Type.

Remarks
Unknown
Enumerator
e_classIdCUnit 

Generic.

◆ ECmdFlags

enum ECmdFlags

Command Flags.

Remarks
Unknown
Enumerator
e_cmdFlagAlternate 

Alternate.

e_cmdFlagQueued 

Queued.

e_cmdFlagPreempt 

Preempt.

e_cmdFlagSmartClick 

Smart Click.

e_cmdFlagSmartRally 

Smart Rally.

e_cmdFlagSubgroup 

Subgroup.

e_cmdFlagSetAutoCast 

Set Auto Cast.

e_cmdFlagSetAutoCastOn 

Set Auto Cast On.

◆ EDeathReveal

Death Reveal.

Remarks
Enum
Enumerator
e_deathRevealVision 

Vision.

e_deathRevealSnapshot 

Snapshot.

◆ EKillDisplay

Kill Display.

Remarks
Enum
Enumerator
e_killDisplayDefault 

Default.

e_killDisplayAlways 

Always.

e_killDisplayNever 

Never.

◆ ERankDisplay

Rank Display.

Remarks
Enum
Enumerator
e_rankDisplayDefault 

Default.

e_rankDisplayAlways 

Always.

e_rankDisplayNever 

Never.

◆ EUnitAttribute

Unit Attribute.

Remarks
Enum
Enumerator
e_unitAttributeLight 
e_unitAttributeArmored 
e_unitAttributeBiological 
e_unitAttributeMechanical 
e_unitAttributeRobotic 
e_unitAttributePsionic 
e_unitAttributeMassive 
e_unitAttributeStructure 
e_unitAttributeHover 
e_unitAttributeHeroic 
e_unitAttributeSummoned 

◆ EUnitCollide

Unit Collide.

Remarks
Unknown
Enumerator
e_unitCollideLand1 

Burrow.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand2 

Ground.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand3 

Larva.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand4 

Swarm.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand5 

Colossus.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand6 

Structure.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand7 

Roach Burrow.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand8 

Tiny Critter.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand9 

ForceField.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand10 

Unused (Land 10)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand11 

Unused (Land 11)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand12 

Unused (Land 12)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand13 

D-8 Charge.

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand14 

Unused (Land 14)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand15 

Unused (Land 15)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideLand16 

Unused (Land 16)

Ground collision flag. A unit uses ground collision if there are no collision flags set, or at least 1 ground collision flag set. Two units that have at least 1 matching ground collision flag cannot occupy the same space. The space a unit occupies is determined by its inner radius.

e_unitCollideAir1 

Flying.

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir2 

Flying Immobile.

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir3 

Flying Escorts.

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir4 

Unused (Air 04)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir5 

Unused (Air 05)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir6 

Unused (Air 06)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir7 

Unused (Air 07)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir8 

Unused (Air 08)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir9 

Unused (Air 09)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir10 

Unused (Air 10)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir11 

Unused (Air 11)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir12 

Unused (Air 12)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir13 

Unused (Air 13)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir14 

Unused (Air 14)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir15 

Unused (Air 15)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

e_unitCollideAir16 

Unused (Air 16)

Air collision flag. A unit uses air collision if there are no ground collision flags set, and at least 1 air collision flag set. Two units that use air collision and have at least 1 matching collision flag can occupy the same space, but will separate from each other.

◆ EUnitEffect

Unit Effect.

Remarks
Unknown
Enumerator
e_unitEffectCreate 

Create.

e_unitEffectBirth 

Birth.

e_unitEffectDeath 

Death.

e_unitEffectRevive 

Revive.

◆ EUnitFlag

enum EUnitFlag

Unit Flag.

Remarks
Unknown
Enumerator
e_unitFlagBounce 

Bounce.

e_unitFlagTurnable 

Turnable.

e_unitFlagMovable 

Movable.

e_unitFlagWorker 

Worker.

e_unitFlagCreateVisible 

Create Visible.

e_unitFlagUnclickable 

Cannot Be Clicked.

e_unitFlagUncommandable 

Uncommandable.

e_unitFlagUnhighlightable 

Cannot Be Highlighted.

e_unitFlagUntooltipable 

No Tooltip.

e_unitFlagUnselectable 

Unselectable.

e_unitFlagUntargetable 

Untargetable.

e_unitFlagUncursorable 

No Cursor.

e_unitFlagHero 

Hero.

e_unitFlagHiddenCargoUI 

Hidden Cargo UI.

e_unitFlagIndividualSubgroups 

Individual Subgroups.

e_unitFlagNoDraw 

No Draw.

e_unitFlagPreventReveal 

Prevent Reveal.

e_unitFlagPreventDefeat 

Prevent Defeat.

e_unitFlagPreventDestroy 

Prevent Destroy.

e_unitFlagPenaltyRevealed 

Penalty Revealed.

e_unitFlagUncloakable 

Uncloakable.

e_unitFlagMissile 

Missile.

e_unitFlagUndetectable 

Undetectable.

e_unitFlagUnradarable 

Not On Radar.

e_unitFlagUseLineOfSight 

Use Line of Sight.

e_unitFlagKillCredit 

Kill Credit.

e_unitFlagTownAlert 

Use Town Alert.

e_unitFlagInvulnerable 

Invulnerable.

e_unitFlagDestructible 

Destructible.

e_unitFlagCloaked 

Cloaked.

e_unitFlagBuried 

Buried.

e_unitFlagNoScore 

No Score.

e_unitFlagIgnoreTerrainZInit 

Ignore Terrain Height.

e_unitFlagTurnBeforeMove 

Turn Before Moving.

e_unitFlagAlwaysThreatens 

Always a Threat to Attackers.

e_unitFlagNoDeathEvent 

No Death Event.

e_unitFlagNoPortraitTalk 

No Portrait Talk.

e_unitFlagTownCamera 

Town Camera.

e_unitFlagAIThreatGround 

AI Threatens Air Units.

e_unitFlagAIThreatAir 

AI Threat (Air)

e_unitFlagAILifetime 

AI Tag For Temporary Units.

e_unitFlagAISplash 

AI Tag For Area of Effect/Splash Damage Units.

e_unitFlagAIHighPrioTarget 

AI Tag For Marking Special High Priority Targets.

e_unitFlagAISplitter 

AI Tag For Splitter Wave Behavior.

e_unitFlagAIDefense 

AI Tag For Defense Units.

e_unitFlagAICaster 

AI Caster.

e_unitFlagAISupport 

AI Tag For Support Units.

e_unitFlagShowResources 

Show Resources.

e_unitFlagArmorDisabledWhileConstructing 

No Armor While Constructing.

e_unitFlagPawnable 

Pawnable.

e_unitFlagAIFleeDamageDisabled 

AI Disable Flee On Damage.

e_unitFlagAIPressForwardDisabled 

AI Disable Press Forward.

e_unitFlagAIObservatory 

AI Observatory.

e_unitFlagForceCollisionCheck 

Always Check Collision.

e_unitFlagAIChangeling 

AI Changeling.

e_unitFlagShareControl 

Share Control.

e_unitFlagBuiltOnOptional 

Built On Optional.

e_unitFlagAcquireRally 

Acquire Rally.

e_unitFlagAIAllowSuicideOverride 

AI Unit Obeys Suicide Even If It's Not A Normal Attacking Unit.

e_unitFlagAIForceTactical 

AI Flag To Force Tactical Think Called Even On Inactive AI/ScriptControlled.

e_unitFlagVisionTestCenterOnly 

Vision Test Center Only.

e_unitFlagUnstoppable 

Unstoppable.

e_unitFlagAIPreferBurrow 

AI Prefer Burrow.

e_unitFlagClearRallyOnDeath 

Clear Rally On Death.

e_unitFlagSelectableWhileDead 

Selectable While Dead.

e_unitFlagTargetableWhileDead 

Targetable While Dead.

e_unitFlagIgnoreAttackAlert 

Ignore Attack Alert.

e_unitFlagPreferLastAttackTarget 

Prefer Last Attack Target.

e_unitFlagAIResourceBlocker 

AI Resource Blocker.

e_unitFlagArmySelect 

Army Select.

◆ EUnitResponse

Unit Response.

Remarks
Enum
Enumerator
e_unitResponseNothing 

No Response.

e_unitResponseFlee 

Flee.

e_unitResponseAcquire 

Acquire.

e_unitResponseAcquireNoFlee 

Acquire No Flee.

Variable Documentation

◆ e_cardButtonTypeCount

const int32 e_cardButtonTypeCount = 9

◆ e_classIdCUnitCount

const int32 e_classIdCUnitCount = 1

◆ e_cmdFlagCount

const int32 e_cmdFlagCount = 8

◆ e_deathRevealCount

const int32 e_deathRevealCount = 2

◆ e_killDisplayCount

const int32 e_killDisplayCount = 3

◆ e_rankDisplayCount

const int32 e_rankDisplayCount = 3

◆ e_unitAttributeCount

const int32 e_unitAttributeCount = 11

◆ e_unitCollideCount

const int32 e_unitCollideCount = 32

◆ e_unitEffectCount

const int32 e_unitEffectCount = 4

◆ e_unitFlagCount

const int32 e_unitFlagCount = 70

◆ e_unitResponseCount

const int32 e_unitResponseCount = 4