UnitType Enum
The UnitType enum defines various types of units in Dota 2, categorizing them based on their attributes and roles in the game. Certain unit types combine properties of others using bitwise flags.
Enum Values
| Name | Value | Description |
|---|---|---|
DOTA_UNIT_NONE | 0 | Represents no unit type. |
DOTA_UNIT_HERO | 1 | Represents a hero unit. |
DOTA_UNIT_STRUCTURE | 16 | Represents a structure, such as buildings or static objects. |
DOTA_UNIT_TOWER | 20 | Represents a tower unit (`DOTA_UNIT_STRUCTURE |
DOTA_UNIT_ANCIENT | 48 | Represents an ancient unit (`32 |
DOTA_UNIT_BARRACKS | 80 | Represents a barracks unit (`64 |
DOTA_UNIT_CREEP | 128 | Represents a creep unit. |
DOTA_UNIT_COURIER | 256 | Represents a courier unit. |
DOTA_UNIT_SHOPKEEP | 528 | Represents a shopkeeper unit (`512 |
DOTA_UNIT_LANE_CREEP | 1152 | Represents a lane creep unit (`1024 |
DOTA_UNIT_ROSHAN | 2176 | Represents Roshan (`2048 |
Notes
The values for combined unit types are calculated using bitwise OR operations. For example:
This structure allows efficient categorization and identification of units in the game.
NOTE
The values for combined unit types are calculated using bitwise OR operations.
For example:
DOTA_UNIT_TOWER = DOTA_UNIT_STRUCTURE | 4DOTA_UNIT_ANCIENT = 32 | DOTA_UNIT_STRUCTUREDOTA_UNIT_LANE_CREEP = 1024 | DOTA_UNIT_CREEPDOTA_UNIT_ROSHAN = 2048 | DOTA_UNIT_CREEP