Skip to content

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

NameValueDescription
DOTA_UNIT_NONE0Represents no unit type.
DOTA_UNIT_HERO1Represents a hero unit.
DOTA_UNIT_STRUCTURE16Represents a structure, such as buildings or static objects.
DOTA_UNIT_TOWER20Represents a tower unit (`DOTA_UNIT_STRUCTURE
DOTA_UNIT_ANCIENT48Represents an ancient unit (`32
DOTA_UNIT_BARRACKS80Represents a barracks unit (`64
DOTA_UNIT_CREEP128Represents a creep unit.
DOTA_UNIT_COURIER256Represents a courier unit.
DOTA_UNIT_SHOPKEEP528Represents a shopkeeper unit (`512
DOTA_UNIT_LANE_CREEP1152Represents a lane creep unit (`1024
DOTA_UNIT_ROSHAN2176Represents 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 | 4
  • DOTA_UNIT_ANCIENT = 32 | DOTA_UNIT_STRUCTURE
  • DOTA_UNIT_LANE_CREEP = 1024 | DOTA_UNIT_CREEP
  • DOTA_UNIT_ROSHAN = 2048 | DOTA_UNIT_CREEP