sc2nachos.units
The units of a game, each under one id for the whole game, and collections of them.
1"""The units of a game, each under one id for the whole game, and collections of them.""" 2 3from sc2nachos._shared.errors import NotReportedError 4from sc2nachos.gamedata._unit_type import UnitType 5from sc2nachos.units._errors import UnitIdsExhaustedError, UnknownTagError 6from sc2nachos.units._own_unit import OwnUnit 7from sc2nachos.units._progress import Progress 8from sc2nachos.units._unit import Unit 9from sc2nachos.units._unit_dict import UnitDict 10from sc2nachos.units._units import Units 11from sc2nachos.units._values import ( 12 Alliance, 13 CloakState, 14 Order, 15 Passenger, 16 RallyTarget, 17 Target, 18 Visibility, 19 VitalType, 20) 21 22__all__ = [ 23 "Alliance", 24 "CloakState", 25 "UnitType", 26 "NotReportedError", 27 "Order", 28 "OwnUnit", 29 "Passenger", 30 "Progress", 31 "RallyTarget", 32 "Target", 33 "Unit", 34 "UnitDict", 35 "UnitIdsExhaustedError", 36 "Units", 37 "UnknownTagError", 38 "Visibility", 39 "VitalType", 40]
25class Alliance(ReadableIntEnum): 26 """Whose side a unit is on, from this player's point of view.""" 27 28 OWN = raw_pb2.Alliance.Self 29 ALLY = raw_pb2.Alliance.Ally 30 NEUTRAL = raw_pb2.Alliance.Neutral 31 ENEMY = raw_pb2.Alliance.Enemy
Whose side a unit is on, from this player's point of view.
51class CloakState(ReadableIntEnum): 52 """Whether a unit is cloaked, and whether this player sees through it.""" 53 54 UNKNOWN = raw_pb2.CloakState.CloakedUnknown 55 """Whether the unit is cloaked is not known: a remembered structure, or an enemy's burrowed widow mine listed 56 invisible (corpus).""" 57 CLOAKED = raw_pb2.CloakState.Cloaked 58 """Cloaked, and nothing of this player's detects it.""" 59 CLOAKED_DETECTED = raw_pb2.CloakState.CloakedDetected 60 """Cloaked and detected.""" 61 NOT_CLOAKED = raw_pb2.CloakState.NotCloaked 62 """Not cloaked.""" 63 CLOAKED_ALLIED = raw_pb2.CloakState.CloakedAllied 64 """Cloaked, but on this player's side, so seen anyway."""
Whether a unit is cloaked, and whether this player sees through it.
Whether the unit is cloaked is not known: a remembered structure, or an enemy's burrowed widow mine listed invisible (corpus).
20class UnitType: 21 """Every type of unit, and every group of types, for the type checker. None is ever instantiated. 22 23 `Unit[UnitType.Marine]` is a marine, and `Unit[UnitType.ProtossStructure]` a Protoss structure. A type's `id` is its 24 `UnitTypeId`. A group is a race, the structures, the types that are not, or the structures of a race, as the game's 25 tables give them; or the workers, the townhalls, the Terran and the Zerg townhalls, what workers gather at, the 26 mineral fields, the vespene geysers, the gas buildings, each race's on a plain or a rich geyser, the collapsible 27 towers and their debris, the destructible rocks, the inhibitor and acceleration zones, the critters, the 28 changelings, the creep tumors, the locusts, the cocoons, the add-ons, tech labs and reactors, the spires, the 29 overlords, the units each Terran and Protoss production structure makes, or the two forms of a structure or a unit 30 that changes and changes back, such as a supply depot raised or lowered, a siege tank sieged or not, or a roach 31 burrowed or not. Each group is in every group that holds all its types: `AnySupplyDepot` is a `TerranStructure`, 32 `AnyDrone` a `Worker`, `AnySiegeTank` a `FactoryUnit`, `Townhall` a `Structure`, and `Worker` a `NonStructure`. A 33 type's `UnitTypeData.equivalent_types` is the group of two forms it is in, or else its own class. 34 35 `includes(unit)` tells whether a unit is of a type or group, narrowing it, `type_ids` holds its ids, and 36 `types_are_equivalent` whether a unit converts between its types and back at will. 37 """ 38 39 class AnyType: 40 """Any type of unit, and what every type and group is. 41 42 `type[UnitType.AnyType]` takes any of them. `Unit[Any]` is a unit that reads as any type, where 43 `Unit[UnitType.AnyType]` is one whose type the type checker does not know, so a read only some types have is an 44 error on it until `includes` narrows it. 45 """ 46 47 type_ids: ClassVar[frozenset[UnitTypeId]] = frozenset() 48 """The ids this class stands for: a type's own `id`, or those of every type in a group. A type id with no unit 49 is tested against them, as for a structure about to be built: `type_id in UnitType.GasBuilding.type_ids`. A 50 unit is tested by `includes`, which narrows it.""" 51 52 types_are_equivalent: ClassVar[bool] = False 53 """Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and 54 unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as 55 `UnitType.AnySiegeTank`, the `UnitTypeData.equivalent_types` of its types. No class reads False in a group that 56 reads True. Any other group reads False, and a class in it may still read True, as `UnitType.Marine` does in 57 `UnitType.BarracksUnit`.""" 58 59 def __init_subclass__(cls) -> None: 60 """Add the type a class names by its `id` to every group it is in. A class with an `id` is a single type, 61 whose types are equivalent, and one without is a group.""" 62 super().__init_subclass__() 63 type_id: UnitTypeId | None = cls.__dict__.get("id") 64 cls.type_ids = frozenset() if type_id is None else frozenset((type_id,)) 65 if type_id is not None: 66 cls.types_are_equivalent = True 67 # Everything between the class and `object` is a group it is in, `AnyType` included. 68 for group in cast("tuple[type[UnitType.AnyType], ...]", cls.__mro__[1:-1]): 69 group.type_ids |= cls.type_ids 70 71 @overload 72 @classmethod 73 def includes(cls, unit: OwnUnit[Any], /) -> TypeGuard[OwnUnit[Self]]: ... 74 75 @overload 76 @classmethod 77 def includes(cls, unit: Unit[Any], /) -> TypeGuard[Unit[Self]]: ... 78 79 @classmethod 80 def includes(cls, unit: Unit[Any], /) -> bool: 81 """Whether `unit` is of this type, or of a type in this group, narrowing it for the type checker. 82 83 Raises `UncuratedIdError` for a unit of a type the curated ids leave out. 84 """ 85 return unit.type_id in cls.type_ids 86 87 class Structure(AnyType): 88 """A type the game's tables give the structure attribute.""" 89 90 class NonStructure(AnyType): 91 """A type the game's tables do not give the structure attribute.""" 92 93 class Terran(AnyType): 94 """A Terran type.""" 95 96 class Zerg(AnyType): 97 """A Zerg type.""" 98 99 class Protoss(AnyType): 100 """A Protoss type.""" 101 102 class TerranStructure(Terran, Structure): 103 """A Terran structure.""" 104 105 class ZergStructure(Zerg, Structure): 106 """A Zerg structure.""" 107 108 class ProtossStructure(Protoss, Structure): 109 """A Protoss structure.""" 110 111 class Worker(NonStructure): 112 """A worker: an SCV, a probe or a drone, burrowed or not. A MULE is none.""" 113 114 class Townhall(Structure): 115 """A townhall: a command center or what it becomes, lifted or not, a nexus, a hatchery, lair or hive.""" 116 117 class AnyTerranTownhall(Townhall, TerranStructure): 118 """A command center or an orbital command, lifted or not, or a planetary fortress.""" 119 120 class AnyZergTownhall(Townhall, ZergStructure): 121 """A Zerg townhall: a hatchery, a lair or a hive.""" 122 123 class AnyResource(Structure): 124 """What a worker gathers at: a mineral field or a gas building, never the geyser under it.""" 125 126 class AnyMineralField(AnyResource): 127 """A mineral field of any kind: one the game's tables say holds minerals.""" 128 129 class AnyVespeneGeyser(Structure): 130 """A vespene geyser of any kind: one the game's tables say holds vespene, of no race.""" 131 132 class GasBuilding(AnyResource): 133 """A refinery, an assimilator or an extractor: one the game's tables say holds vespene, of a race.""" 134 135 class AnyRefinery(GasBuilding, TerranStructure): 136 """A refinery, on a plain or a rich geyser.""" 137 138 class AnyExtractor(GasBuilding, ZergStructure): 139 """An extractor, on a plain or a rich geyser.""" 140 141 class AnyAssimilator(GasBuilding, ProtossStructure): 142 """An assimilator, on a plain or a rich geyser.""" 143 144 class Destructible(Structure): 145 """A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.""" 146 147 class CollapsibleTower(Destructible): 148 """A collapsible tower, which falls across a path once destroyed and stays there.""" 149 150 class CollapsibleTowerDebris(Destructible): 151 """The debris a collapsible tower leaves where it lands once felled.""" 152 153 class InhibitorZone(AnyType): 154 """An inhibitor zone generator, of any size, plain or flying.""" 155 156 class AccelerationZone(NonStructure): 157 """An acceleration zone generator, of any size, plain or flying.""" 158 159 class Critter(NonStructure): 160 """One of a map's critters: an animal or a robot that wanders and covers no ground.""" 161 162 class AnyChangeling(NonStructure, Zerg): 163 """A changeling, plain or in the shape of a marine, a zealot or a zergling.""" 164 165 class AnyCreepTumor(ZergStructure): 166 """A creep tumor, a queen's or another tumor's, growing or burrowed.""" 167 168 class AnyLocust(NonStructure, Zerg): 169 """A locust, on the ground or flying.""" 170 171 class Cocoon(NonStructure, Zerg): 172 """A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.""" 173 174 class AnyAddOn(TerranStructure): 175 """An add-on of any kind: a tech lab or a reactor, attached to its host or plain.""" 176 177 class AnyTechLab(AnyAddOn): 178 """A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.""" 179 180 class AnyReactor(AnyAddOn): 181 """A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.""" 182 183 class AnySpire(ZergStructure): 184 """A spire or a greater spire.""" 185 186 class AnyOverlord(NonStructure, Zerg): 187 """An overlord, a transport overlord, or an overseer in either mode, which the tables count as one.""" 188 189 class BarracksUnit(NonStructure, Terran): 190 """A unit a barracks trains: a marine, a marauder, a reaper or a ghost.""" 191 192 class FactoryUnit(NonStructure, Terran): 193 """A unit a factory makes, in any form: a hellion or hellbat, a widow mine, siege tank, cyclone or thor.""" 194 195 class StarportUnit(NonStructure, Terran): 196 """A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.""" 197 198 class GatewayUnit(NonStructure, Protoss): 199 """A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.""" 200 201 class RoboticsFacilityUnit(NonStructure, Protoss): 202 """A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor.""" 203 204 class StargateUnit(NonStructure, Protoss): 205 """A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.""" 206 207 class AnySupplyDepot(TerranStructure): 208 """A supply depot, raised or lowered.""" 209 210 types_are_equivalent = True 211 212 class AnyBarracks(TerranStructure): 213 """A barracks, landed or flying.""" 214 215 types_are_equivalent = True 216 217 class AnyFactory(TerranStructure): 218 """A factory, landed or flying.""" 219 220 types_are_equivalent = True 221 222 class AnyStarport(TerranStructure): 223 """A starport, landed or flying.""" 224 225 types_are_equivalent = True 226 227 class AnyCommandCenter(AnyTerranTownhall): 228 """A command center, landed or flying. An orbital command and a planetary fortress are none.""" 229 230 types_are_equivalent = True 231 232 class AnyOrbitalCommand(AnyTerranTownhall): 233 """An orbital command, landed or flying.""" 234 235 types_are_equivalent = True 236 237 class AnyGateway(ProtossStructure): 238 """A gateway or a warp gate.""" 239 240 types_are_equivalent = True 241 242 class AnySpineCrawler(ZergStructure): 243 """A spine crawler, rooted or uprooted.""" 244 245 types_are_equivalent = True 246 247 class AnySporeCrawler(ZergStructure): 248 """A spore crawler, rooted or uprooted.""" 249 250 types_are_equivalent = True 251 252 class AnyViking(StarportUnit): 253 """A viking, flying or landed.""" 254 255 types_are_equivalent = True 256 257 class AnySiegeTank(FactoryUnit): 258 """A siege tank, sieged or not.""" 259 260 types_are_equivalent = True 261 262 class AnyWidowMine(FactoryUnit): 263 """A widow mine, burrowed or not.""" 264 265 types_are_equivalent = True 266 267 class AnyLiberator(StarportUnit): 268 """A liberator, sieged or not.""" 269 270 types_are_equivalent = True 271 272 class AnyThor(FactoryUnit): 273 """A thor, in either mode.""" 274 275 types_are_equivalent = True 276 277 class AnyHellion(FactoryUnit): 278 """A hellion or a hellbat.""" 279 280 types_are_equivalent = True 281 282 class AnyObserver(RoboticsFacilityUnit): 283 """An observer, in surveillance mode or not.""" 284 285 types_are_equivalent = True 286 287 class AnyOverseer(AnyOverlord): 288 """An overseer, in oversight mode or not.""" 289 290 types_are_equivalent = True 291 292 class AnyWarpPrism(RoboticsFacilityUnit): 293 """A warp prism, phasing or not.""" 294 295 types_are_equivalent = True 296 297 class AnyDrone(Worker, Zerg): 298 """A drone, burrowed or not.""" 299 300 types_are_equivalent = True 301 302 class AnyZergling(NonStructure, Zerg): 303 """A zergling, burrowed or not.""" 304 305 types_are_equivalent = True 306 307 class AnyBaneling(NonStructure, Zerg): 308 """A baneling, burrowed or not.""" 309 310 types_are_equivalent = True 311 312 class AnyRoach(NonStructure, Zerg): 313 """A roach, burrowed or not.""" 314 315 types_are_equivalent = True 316 317 class AnyRavager(NonStructure, Zerg): 318 """A ravager, burrowed or not.""" 319 320 types_are_equivalent = True 321 322 class AnyHydralisk(NonStructure, Zerg): 323 """A hydralisk, burrowed or not.""" 324 325 types_are_equivalent = True 326 327 class AnyLurker(NonStructure, Zerg): 328 """A lurker, burrowed or not.""" 329 330 types_are_equivalent = True 331 332 class AnyInfestor(NonStructure, Zerg): 333 """An infestor, burrowed or not.""" 334 335 types_are_equivalent = True 336 337 class AnySwarmHost(NonStructure, Zerg): 338 """A swarm host, burrowed or not.""" 339 340 types_are_equivalent = True 341 342 class AnyUltralisk(NonStructure, Zerg): 343 """An ultralisk, burrowed or not.""" 344 345 types_are_equivalent = True 346 347 class AnyQueen(NonStructure, Zerg): 348 """A queen, burrowed or not.""" 349 350 types_are_equivalent = True 351 352 class AccelerationZoneFlyingLarge(AccelerationZone): 353 id = UnitTypeId.ACCELERATION_ZONE_FLYING_LARGE 354 355 class AccelerationZoneFlyingMedium(AccelerationZone): 356 id = UnitTypeId.ACCELERATION_ZONE_FLYING_MEDIUM 357 358 class AccelerationZoneFlyingSmall(AccelerationZone): 359 id = UnitTypeId.ACCELERATION_ZONE_FLYING_SMALL 360 361 class AccelerationZoneLarge(AccelerationZone): 362 id = UnitTypeId.ACCELERATION_ZONE_LARGE 363 364 class AccelerationZoneMedium(AccelerationZone): 365 id = UnitTypeId.ACCELERATION_ZONE_MEDIUM 366 367 class AccelerationZoneSmall(AccelerationZone): 368 id = UnitTypeId.ACCELERATION_ZONE_SMALL 369 370 class Adept(GatewayUnit): 371 id = UnitTypeId.ADEPT 372 373 class AdeptShade(NonStructure, Protoss): 374 id = UnitTypeId.ADEPT_SHADE 375 376 class Archon(NonStructure, Protoss): 377 id = UnitTypeId.ARCHON 378 379 class Armory(TerranStructure): 380 id = UnitTypeId.ARMORY 381 382 class Assimilator(AnyAssimilator): 383 id = UnitTypeId.ASSIMILATOR 384 385 class AssimilatorRich(AnyAssimilator): 386 id = UnitTypeId.ASSIMILATOR_RICH 387 388 class AutoTurret(TerranStructure): 389 id = UnitTypeId.AUTO_TURRET 390 391 class Baneling(AnyBaneling): 392 id = UnitTypeId.BANELING 393 394 class BanelingBurrowed(AnyBaneling): 395 id = UnitTypeId.BANELING_BURROWED 396 397 class BanelingCocoon(Cocoon): 398 id = UnitTypeId.BANELING_COCOON 399 400 class BanelingNest(ZergStructure): 401 id = UnitTypeId.BANELING_NEST 402 403 class Banshee(StarportUnit): 404 id = UnitTypeId.BANSHEE 405 406 class Barracks(AnyBarracks): 407 id = UnitTypeId.BARRACKS 408 409 class BarracksFlying(AnyBarracks): 410 id = UnitTypeId.BARRACKS_FLYING 411 412 class Battlecruiser(StarportUnit): 413 id = UnitTypeId.BATTLECRUISER 414 415 class BroodLord(NonStructure, Zerg): 416 id = UnitTypeId.BROOD_LORD 417 418 class BroodLordCocoon(Cocoon): 419 id = UnitTypeId.BROOD_LORD_COCOON 420 421 class Broodling(NonStructure, Zerg): 422 id = UnitTypeId.BROODLING 423 424 class Bunker(TerranStructure): 425 id = UnitTypeId.BUNKER 426 427 class Carrier(StargateUnit): 428 id = UnitTypeId.CARRIER 429 430 class Changeling(AnyChangeling): 431 id = UnitTypeId.CHANGELING 432 433 class ChangelingMarine(AnyChangeling): 434 id = UnitTypeId.CHANGELING_MARINE 435 436 class ChangelingMarineShield(AnyChangeling): 437 id = UnitTypeId.CHANGELING_MARINE_SHIELD 438 439 class ChangelingZealot(AnyChangeling): 440 id = UnitTypeId.CHANGELING_ZEALOT 441 442 class ChangelingZergling(AnyChangeling): 443 id = UnitTypeId.CHANGELING_ZERGLING 444 445 class ChangelingZerglingWings(AnyChangeling): 446 id = UnitTypeId.CHANGELING_ZERGLING_WINGS 447 448 class CollapsibleTowerDebrisPurifier(CollapsibleTowerDebris): 449 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_PURIFIER 450 451 class CollapsibleTowerDebrisRampLeftRock(CollapsibleTowerDebris): 452 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_LEFT_ROCK 453 454 class CollapsibleTowerDebrisRampLeftRockGreen(CollapsibleTowerDebris): 455 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_LEFT_ROCK_GREEN 456 457 class CollapsibleTowerDebrisRampRightRock(CollapsibleTowerDebris): 458 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_RIGHT_ROCK 459 460 class CollapsibleTowerDebrisRampRightRockGreen(CollapsibleTowerDebris): 461 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_RIGHT_ROCK_GREEN 462 463 class CollapsibleTowerDebrisRock(CollapsibleTowerDebris): 464 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_ROCK 465 466 class CollapsibleTowerDebrisTerran(CollapsibleTowerDebris): 467 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_TERRAN 468 469 class CollapsibleTowerDiagonalPurifier(CollapsibleTower): 470 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_PURIFIER 471 472 class CollapsibleTowerDiagonalRock(CollapsibleTower): 473 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_ROCK 474 475 class CollapsibleTowerDiagonalTerran(CollapsibleTower): 476 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_TERRAN 477 478 class CollapsibleTowerPushUnitPurifier(Structure): 479 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_PURIFIER 480 481 class CollapsibleTowerPushUnitRampLeftRock(Structure): 482 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_ROCK 483 484 class CollapsibleTowerPushUnitRampLeftRockGreen(Structure): 485 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_ROCK_GREEN 486 487 class CollapsibleTowerPushUnitRampLeftTerran(Structure): 488 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_TERRAN 489 490 class CollapsibleTowerPushUnitRampRightRock(Structure): 491 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_ROCK 492 493 class CollapsibleTowerPushUnitRampRightRockGreen(Structure): 494 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_ROCK_GREEN 495 496 class CollapsibleTowerPushUnitRampRightTerran(Structure): 497 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_TERRAN 498 499 class CollapsibleTowerPushUnitRock(Structure): 500 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_ROCK 501 502 class CollapsibleTowerPushUnitTerran(Structure): 503 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_TERRAN 504 505 class CollapsibleTowerRampLeftRock(CollapsibleTower): 506 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_ROCK 507 508 class CollapsibleTowerRampLeftRockGreen(CollapsibleTower): 509 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_ROCK_GREEN 510 511 class CollapsibleTowerRampLeftTerran(CollapsibleTower): 512 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_TERRAN 513 514 class CollapsibleTowerRampRightRock(CollapsibleTower): 515 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_ROCK 516 517 class CollapsibleTowerRampRightRockGreen(CollapsibleTower): 518 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_ROCK_GREEN 519 520 class CollapsibleTowerRampRightTerran(CollapsibleTower): 521 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_TERRAN 522 523 class CollapsibleTowerRock(CollapsibleTower): 524 id = UnitTypeId.COLLAPSIBLE_TOWER_ROCK 525 526 class CollapsibleTowerTerran(CollapsibleTower): 527 id = UnitTypeId.COLLAPSIBLE_TOWER_TERRAN 528 529 class Colossus(RoboticsFacilityUnit): 530 id = UnitTypeId.COLOSSUS 531 532 class CommandCenter(AnyCommandCenter): 533 id = UnitTypeId.COMMAND_CENTER 534 535 class CommandCenterFlying(AnyCommandCenter): 536 id = UnitTypeId.COMMAND_CENTER_FLYING 537 538 class Corruptor(NonStructure, Zerg): 539 id = UnitTypeId.CORRUPTOR 540 541 class CreepTumor(AnyCreepTumor): 542 id = UnitTypeId.CREEP_TUMOR 543 544 class CreepTumorBurrowed(AnyCreepTumor): 545 id = UnitTypeId.CREEP_TUMOR_BURROWED 546 547 class CreepTumorQueen(AnyCreepTumor): 548 id = UnitTypeId.CREEP_TUMOR_QUEEN 549 550 class CritterCleaningBot(Critter): 551 id = UnitTypeId.CRITTER_CLEANING_BOT 552 553 class CritterLabBot(Critter): 554 id = UnitTypeId.CRITTER_LAB_BOT 555 556 class CyberneticsCore(ProtossStructure): 557 id = UnitTypeId.CYBERNETICS_CORE 558 559 class Cyclone(FactoryUnit): 560 id = UnitTypeId.CYCLONE 561 562 class DarkShrine(ProtossStructure): 563 id = UnitTypeId.DARK_SHRINE 564 565 class DarkTemplar(GatewayUnit): 566 id = UnitTypeId.DARK_TEMPLAR 567 568 class Destructible1x1BraxisAlpha(Destructible): 569 id = UnitTypeId.DESTRUCTIBLE_1X1_BRAXIS_ALPHA 570 571 class Destructible2x2BraxisAlpha(Destructible): 572 id = UnitTypeId.DESTRUCTIBLE_2X2_BRAXIS_ALPHA 573 574 class Destructible2x4HorizontalCityDebris(Destructible): 575 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_CITY_DEBRIS 576 577 class Destructible2x4HorizontalIce(Destructible): 578 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ICE 579 580 class Destructible2x4HorizontalRock(Destructible): 581 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ROCK 582 583 class Destructible2x4HorizontalRockEx1(Destructible): 584 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ROCK_EX1 585 586 class Destructible2x4VerticalCityDebris(Destructible): 587 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_CITY_DEBRIS 588 589 class Destructible2x4VerticalIce(Destructible): 590 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ICE 591 592 class Destructible2x4VerticalRock(Destructible): 593 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ROCK 594 595 class Destructible2x4VerticalRockEx1(Destructible): 596 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ROCK_EX1 597 598 class Destructible2x6HorizontalCityDebris(Destructible): 599 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_CITY_DEBRIS 600 601 class Destructible2x6HorizontalIce(Destructible): 602 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ICE 603 604 class Destructible2x6HorizontalRock(Destructible): 605 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ROCK 606 607 class Destructible2x6HorizontalRockEx1(Destructible): 608 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ROCK_EX1 609 610 class Destructible2x6VerticalCityDebris(Destructible): 611 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_CITY_DEBRIS 612 613 class Destructible2x6VerticalIce(Destructible): 614 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ICE 615 616 class Destructible2x6VerticalRock(Destructible): 617 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ROCK 618 619 class Destructible2x6VerticalRockEx1(Destructible): 620 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ROCK_EX1 621 622 class Destructible3x3ZergInfestation(Destructible): 623 id = UnitTypeId.DESTRUCTIBLE_3X3_ZERG_INFESTATION 624 625 class Destructible4x4CityDebris(Destructible): 626 id = UnitTypeId.DESTRUCTIBLE_4X4_CITY_DEBRIS 627 628 class Destructible4x4Debris(Destructible): 629 id = UnitTypeId.DESTRUCTIBLE_4X4_DEBRIS 630 631 class Destructible4x4Ice(Destructible): 632 id = UnitTypeId.DESTRUCTIBLE_4X4_ICE 633 634 class Destructible4x4Rock(Destructible): 635 id = UnitTypeId.DESTRUCTIBLE_4X4_ROCK 636 637 class Destructible4x4RockEx1(Destructible): 638 id = UnitTypeId.DESTRUCTIBLE_4X4_ROCK_EX1 639 640 class Destructible6x6CityDebris(Destructible): 641 id = UnitTypeId.DESTRUCTIBLE_6X6_CITY_DEBRIS 642 643 class Destructible6x6Debris(Destructible): 644 id = UnitTypeId.DESTRUCTIBLE_6X6_DEBRIS 645 646 class Destructible6x6ExpeditionGate(Destructible): 647 id = UnitTypeId.DESTRUCTIBLE_6X6_EXPEDITION_GATE 648 649 class Destructible6x6Ice(Destructible): 650 id = UnitTypeId.DESTRUCTIBLE_6X6_ICE 651 652 class Destructible6x6Rock(Destructible): 653 id = UnitTypeId.DESTRUCTIBLE_6X6_ROCK 654 655 class Destructible6x6RockEx1(Destructible): 656 id = UnitTypeId.DESTRUCTIBLE_6X6_ROCK_EX1 657 658 class Destructible6x6WeakRock(Destructible): 659 id = UnitTypeId.DESTRUCTIBLE_6X6_WEAK_ROCK 660 661 class DestructibleHugeDiagonalBlurCityDebris(Destructible): 662 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_CITY_DEBRIS 663 664 class DestructibleHugeDiagonalBlurDebrisRamp(Destructible): 665 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_DEBRIS_RAMP 666 667 class DestructibleHugeDiagonalBlurIce(Destructible): 668 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_ICE 669 670 class DestructibleHugeDiagonalBlurRamp(Destructible): 671 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_RAMP 672 673 class DestructibleHugeDiagonalBlurRockEx1(Destructible): 674 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_ROCK_EX1 675 676 class DestructibleHugeDiagonalUlbrCityDebris(Destructible): 677 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_CITY_DEBRIS 678 679 class DestructibleHugeDiagonalUlbrDebrisRamp(Destructible): 680 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_DEBRIS_RAMP 681 682 class DestructibleHugeDiagonalUlbrIce(Destructible): 683 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_ICE 684 685 class DestructibleHugeDiagonalUlbrRamp(Destructible): 686 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_RAMP 687 688 class DestructibleHugeDiagonalUlbrRockEx1(Destructible): 689 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_ROCK_EX1 690 691 class DestructibleHugeHorizontalIce(Destructible): 692 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_ICE 693 694 class DestructibleHugeHorizontalRamp(Destructible): 695 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_RAMP 696 697 class DestructibleHugeHorizontalRockEx1(Destructible): 698 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_ROCK_EX1 699 700 class DestructibleHugeVerticalIce(Destructible): 701 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_ICE 702 703 class DestructibleHugeVerticalRamp(Destructible): 704 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_RAMP 705 706 class DestructibleHugeVerticalRockEx1(Destructible): 707 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_ROCK_EX1 708 709 class DestructibleUnbuildableBricks(Destructible): 710 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_BRICKS 711 712 class DestructibleUnbuildablePlates(Destructible): 713 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_PLATES 714 715 class DestructibleUnbuildableRocks(Destructible): 716 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_ROCKS 717 718 class Disruptor(RoboticsFacilityUnit): 719 id = UnitTypeId.DISRUPTOR 720 721 class Drone(AnyDrone): 722 id = UnitTypeId.DRONE 723 724 class DroneBurrowed(AnyDrone): 725 id = UnitTypeId.DRONE_BURROWED 726 727 class Egg(NonStructure, Zerg): 728 id = UnitTypeId.EGG 729 730 class EngineeringBay(TerranStructure): 731 id = UnitTypeId.ENGINEERING_BAY 732 733 class EvolutionChamber(ZergStructure): 734 id = UnitTypeId.EVOLUTION_CHAMBER 735 736 class Extractor(AnyExtractor): 737 id = UnitTypeId.EXTRACTOR 738 739 class ExtractorRich(AnyExtractor): 740 id = UnitTypeId.EXTRACTOR_RICH 741 742 class Factory(AnyFactory): 743 id = UnitTypeId.FACTORY 744 745 class FactoryFlying(AnyFactory): 746 id = UnitTypeId.FACTORY_FLYING 747 748 class FleetBeacon(ProtossStructure): 749 id = UnitTypeId.FLEET_BEACON 750 751 class ForceField(NonStructure, Protoss): 752 id = UnitTypeId.FORCE_FIELD 753 754 class Forge(ProtossStructure): 755 id = UnitTypeId.FORGE 756 757 class FusionCore(TerranStructure): 758 id = UnitTypeId.FUSION_CORE 759 760 class Gateway(AnyGateway): 761 id = UnitTypeId.GATEWAY 762 763 class Ghost(BarracksUnit): 764 id = UnitTypeId.GHOST 765 766 class GhostAcademy(TerranStructure): 767 id = UnitTypeId.GHOST_ACADEMY 768 769 class GreaterSpire(AnySpire): 770 id = UnitTypeId.GREATER_SPIRE 771 772 class Hatchery(AnyZergTownhall): 773 id = UnitTypeId.HATCHERY 774 775 class HealingShrineXelNaga(NonStructure): 776 id = UnitTypeId.HEALING_SHRINE_XEL_NAGA 777 778 class Hellbat(AnyHellion): 779 id = UnitTypeId.HELLBAT 780 781 class Hellion(AnyHellion): 782 id = UnitTypeId.HELLION 783 784 class HighTemplar(GatewayUnit): 785 id = UnitTypeId.HIGH_TEMPLAR 786 787 class Hive(AnyZergTownhall): 788 id = UnitTypeId.HIVE 789 790 class Hydralisk(AnyHydralisk): 791 id = UnitTypeId.HYDRALISK 792 793 class HydraliskBurrowed(AnyHydralisk): 794 id = UnitTypeId.HYDRALISK_BURROWED 795 796 class HydraliskDen(ZergStructure): 797 id = UnitTypeId.HYDRALISK_DEN 798 799 class Immortal(RoboticsFacilityUnit): 800 id = UnitTypeId.IMMORTAL 801 802 class InfestationPit(ZergStructure): 803 id = UnitTypeId.INFESTATION_PIT 804 805 class Infestor(AnyInfestor): 806 id = UnitTypeId.INFESTOR 807 808 class InfestorBurrowed(AnyInfestor): 809 id = UnitTypeId.INFESTOR_BURROWED 810 811 class InhibitorZoneFlyingLarge(NonStructure, InhibitorZone): 812 id = UnitTypeId.INHIBITOR_ZONE_FLYING_LARGE 813 814 class InhibitorZoneFlyingMedium(NonStructure, InhibitorZone): 815 id = UnitTypeId.INHIBITOR_ZONE_FLYING_MEDIUM 816 817 class InhibitorZoneFlyingSmall(NonStructure, InhibitorZone): 818 id = UnitTypeId.INHIBITOR_ZONE_FLYING_SMALL 819 820 class InhibitorZoneLarge(Structure, InhibitorZone): 821 id = UnitTypeId.INHIBITOR_ZONE_LARGE 822 823 class InhibitorZoneMedium(Structure, InhibitorZone): 824 id = UnitTypeId.INHIBITOR_ZONE_MEDIUM 825 826 class InhibitorZoneSmall(Structure, InhibitorZone): 827 id = UnitTypeId.INHIBITOR_ZONE_SMALL 828 829 class Interceptor(NonStructure, Protoss): 830 id = UnitTypeId.INTERCEPTOR 831 832 class Lair(AnyZergTownhall): 833 id = UnitTypeId.LAIR 834 835 class Larva(NonStructure, Zerg): 836 id = UnitTypeId.LARVA 837 838 class Liberator(AnyLiberator): 839 id = UnitTypeId.LIBERATOR 840 841 class LiberatorSieged(AnyLiberator): 842 id = UnitTypeId.LIBERATOR_SIEGED 843 844 class Locust(AnyLocust): 845 id = UnitTypeId.LOCUST 846 847 class LocustFlying(AnyLocust): 848 id = UnitTypeId.LOCUST_FLYING 849 850 class Lurker(AnyLurker): 851 id = UnitTypeId.LURKER 852 853 class LurkerBurrowed(AnyLurker): 854 id = UnitTypeId.LURKER_BURROWED 855 856 class LurkerDen(ZergStructure): 857 id = UnitTypeId.LURKER_DEN 858 859 class LurkerEgg(Cocoon): 860 id = UnitTypeId.LURKER_EGG 861 862 class Marauder(BarracksUnit): 863 id = UnitTypeId.MARAUDER 864 865 class Marine(BarracksUnit): 866 id = UnitTypeId.MARINE 867 868 class Medivac(StarportUnit): 869 id = UnitTypeId.MEDIVAC 870 871 class MineralField(AnyMineralField): 872 id = UnitTypeId.MINERAL_FIELD 873 874 class MineralField450(AnyMineralField): 875 id = UnitTypeId.MINERAL_FIELD_450 876 877 class MineralField750(AnyMineralField): 878 id = UnitTypeId.MINERAL_FIELD_750 879 880 class MineralField750BattleStation(AnyMineralField): 881 id = UnitTypeId.MINERAL_FIELD_750_BATTLE_STATION 882 883 class MineralField750Lab(AnyMineralField): 884 id = UnitTypeId.MINERAL_FIELD_750_LAB 885 886 class MineralField750Purifier(AnyMineralField): 887 id = UnitTypeId.MINERAL_FIELD_750_PURIFIER 888 889 class MineralField900Opaque(AnyMineralField): 890 id = UnitTypeId.MINERAL_FIELD_900_OPAQUE 891 892 class MineralFieldBattleStation(AnyMineralField): 893 id = UnitTypeId.MINERAL_FIELD_BATTLE_STATION 894 895 class MineralFieldLab(AnyMineralField): 896 id = UnitTypeId.MINERAL_FIELD_LAB 897 898 class MineralFieldOpaque(AnyMineralField): 899 id = UnitTypeId.MINERAL_FIELD_OPAQUE 900 901 class MineralFieldPurifier(AnyMineralField): 902 id = UnitTypeId.MINERAL_FIELD_PURIFIER 903 904 class MineralFieldRich(AnyMineralField): 905 id = UnitTypeId.MINERAL_FIELD_RICH 906 907 class MineralFieldRich750(AnyMineralField): 908 id = UnitTypeId.MINERAL_FIELD_RICH_750 909 910 class MineralFieldRich750Purifier(AnyMineralField): 911 id = UnitTypeId.MINERAL_FIELD_RICH_750_PURIFIER 912 913 class MineralFieldRichPurifier(AnyMineralField): 914 id = UnitTypeId.MINERAL_FIELD_RICH_PURIFIER 915 916 class MissileTurret(TerranStructure): 917 id = UnitTypeId.MISSILE_TURRET 918 919 class Mothership(NonStructure, Protoss): 920 id = UnitTypeId.MOTHERSHIP 921 922 class Mule(NonStructure, Terran): 923 id = UnitTypeId.MULE 924 925 class Mutalisk(NonStructure, Zerg): 926 id = UnitTypeId.MUTALISK 927 928 class Nexus(ProtossStructure, Townhall): 929 id = UnitTypeId.NEXUS 930 931 class NotAUnit(NonStructure): 932 id = UnitTypeId.NOT_A_UNIT 933 934 class NydusNetwork(ZergStructure): 935 id = UnitTypeId.NYDUS_NETWORK 936 937 class NydusWorm(ZergStructure): 938 id = UnitTypeId.NYDUS_WORM 939 940 class Observer(AnyObserver): 941 id = UnitTypeId.OBSERVER 942 943 class ObserverSieged(AnyObserver): 944 id = UnitTypeId.OBSERVER_SIEGED 945 946 class Oracle(StargateUnit): 947 id = UnitTypeId.ORACLE 948 949 class OrbitalCommand(AnyOrbitalCommand): 950 id = UnitTypeId.ORBITAL_COMMAND 951 952 class OrbitalCommandFlying(AnyOrbitalCommand): 953 id = UnitTypeId.ORBITAL_COMMAND_FLYING 954 955 class Overlord(AnyOverlord): 956 id = UnitTypeId.OVERLORD 957 958 class OverlordCocoon(Cocoon): 959 id = UnitTypeId.OVERLORD_COCOON 960 961 class OverlordTransport(AnyOverlord): 962 id = UnitTypeId.OVERLORD_TRANSPORT 963 964 class OverlordTransportCocoon(Cocoon): 965 id = UnitTypeId.OVERLORD_TRANSPORT_COCOON 966 967 class Overseer(AnyOverseer): 968 id = UnitTypeId.OVERSEER 969 970 class OverseerSieged(AnyOverseer): 971 id = UnitTypeId.OVERSEER_SIEGED 972 973 class ParasiticBombLeftBehind(NonStructure, Zerg): 974 id = UnitTypeId.PARASITIC_BOMB_LEFT_BEHIND 975 976 class Phoenix(StargateUnit): 977 id = UnitTypeId.PHOENIX 978 979 class PhotonCannon(ProtossStructure): 980 id = UnitTypeId.PHOTON_CANNON 981 982 class PlanetaryFortress(AnyTerranTownhall): 983 id = UnitTypeId.PLANETARY_FORTRESS 984 985 class Probe(Protoss, Worker): 986 id = UnitTypeId.PROBE 987 988 class PurificationNova(NonStructure, Protoss): 989 id = UnitTypeId.PURIFICATION_NOVA 990 991 class Pylon(ProtossStructure): 992 id = UnitTypeId.PYLON 993 994 class Queen(AnyQueen): 995 id = UnitTypeId.QUEEN 996 997 class QueenBurrowed(AnyQueen): 998 id = UnitTypeId.QUEEN_BURROWED 999 1000 class Ravager(AnyRavager): 1001 id = UnitTypeId.RAVAGER 1002 1003 class RavagerBurrowed(AnyRavager): 1004 id = UnitTypeId.RAVAGER_BURROWED 1005 1006 class RavagerCocoon(Cocoon): 1007 id = UnitTypeId.RAVAGER_COCOON 1008 1009 class Raven(StarportUnit): 1010 id = UnitTypeId.RAVEN 1011 1012 class Reactor(AnyReactor): 1013 id = UnitTypeId.REACTOR 1014 1015 class ReactorBarracks(AnyReactor): 1016 id = UnitTypeId.REACTOR_BARRACKS 1017 1018 class ReactorFactory(AnyReactor): 1019 id = UnitTypeId.REACTOR_FACTORY 1020 1021 class ReactorStarport(AnyReactor): 1022 id = UnitTypeId.REACTOR_STARPORT 1023 1024 class Reaper(BarracksUnit): 1025 id = UnitTypeId.REAPER 1026 1027 class ReaperGrenade(TerranStructure): 1028 id = UnitTypeId.REAPER_GRENADE 1029 1030 class Refinery(AnyRefinery): 1031 id = UnitTypeId.REFINERY 1032 1033 class RefineryRich(AnyRefinery): 1034 id = UnitTypeId.REFINERY_RICH 1035 1036 class Roach(AnyRoach): 1037 id = UnitTypeId.ROACH 1038 1039 class RoachBurrowed(AnyRoach): 1040 id = UnitTypeId.ROACH_BURROWED 1041 1042 class RoachWarren(ZergStructure): 1043 id = UnitTypeId.ROACH_WARREN 1044 1045 class RoboticsBay(ProtossStructure): 1046 id = UnitTypeId.ROBOTICS_BAY 1047 1048 class RoboticsFacility(ProtossStructure): 1049 id = UnitTypeId.ROBOTICS_FACILITY 1050 1051 class Rocks2x2NonConjoined(Structure): 1052 id = UnitTypeId.ROCKS_2X2_NON_CONJOINED 1053 1054 class Scv(Terran, Worker): 1055 id = UnitTypeId.SCV 1056 1057 class SensorTower(TerranStructure): 1058 id = UnitTypeId.SENSOR_TOWER 1059 1060 class Sentry(GatewayUnit): 1061 id = UnitTypeId.SENTRY 1062 1063 class ShieldBattery(ProtossStructure): 1064 id = UnitTypeId.SHIELD_BATTERY 1065 1066 class SiegeTank(AnySiegeTank): 1067 id = UnitTypeId.SIEGE_TANK 1068 1069 class SiegeTankSieged(AnySiegeTank): 1070 id = UnitTypeId.SIEGE_TANK_SIEGED 1071 1072 class SpawningPool(ZergStructure): 1073 id = UnitTypeId.SPAWNING_POOL 1074 1075 class SpineCrawler(AnySpineCrawler): 1076 id = UnitTypeId.SPINE_CRAWLER 1077 1078 class SpineCrawlerUprooted(AnySpineCrawler): 1079 id = UnitTypeId.SPINE_CRAWLER_UPROOTED 1080 1081 class Spire(AnySpire): 1082 id = UnitTypeId.SPIRE 1083 1084 class SporeCrawler(AnySporeCrawler): 1085 id = UnitTypeId.SPORE_CRAWLER 1086 1087 class SporeCrawlerUprooted(AnySporeCrawler): 1088 id = UnitTypeId.SPORE_CRAWLER_UPROOTED 1089 1090 class Stalker(GatewayUnit): 1091 id = UnitTypeId.STALKER 1092 1093 class Stargate(ProtossStructure): 1094 id = UnitTypeId.STARGATE 1095 1096 class Starport(AnyStarport): 1097 id = UnitTypeId.STARPORT 1098 1099 class StarportFlying(AnyStarport): 1100 id = UnitTypeId.STARPORT_FLYING 1101 1102 class StasisWard(ProtossStructure): 1103 id = UnitTypeId.STASIS_WARD 1104 1105 class SupplyDepot(AnySupplyDepot): 1106 id = UnitTypeId.SUPPLY_DEPOT 1107 1108 class SupplyDepotLowered(AnySupplyDepot): 1109 id = UnitTypeId.SUPPLY_DEPOT_LOWERED 1110 1111 class SwarmHost(AnySwarmHost): 1112 id = UnitTypeId.SWARM_HOST 1113 1114 class SwarmHostBurrowed(AnySwarmHost): 1115 id = UnitTypeId.SWARM_HOST_BURROWED 1116 1117 class TechLab(AnyTechLab): 1118 id = UnitTypeId.TECH_LAB 1119 1120 class TechLabBarracks(AnyTechLab): 1121 id = UnitTypeId.TECH_LAB_BARRACKS 1122 1123 class TechLabFactory(AnyTechLab): 1124 id = UnitTypeId.TECH_LAB_FACTORY 1125 1126 class TechLabStarport(AnyTechLab): 1127 id = UnitTypeId.TECH_LAB_STARPORT 1128 1129 class Tempest(StargateUnit): 1130 id = UnitTypeId.TEMPEST 1131 1132 class TemplarArchive(ProtossStructure): 1133 id = UnitTypeId.TEMPLAR_ARCHIVE 1134 1135 class Thor(AnyThor): 1136 id = UnitTypeId.THOR 1137 1138 class ThorHighImpact(AnyThor): 1139 id = UnitTypeId.THOR_HIGH_IMPACT 1140 1141 class TwilightCouncil(ProtossStructure): 1142 id = UnitTypeId.TWILIGHT_COUNCIL 1143 1144 class Ultralisk(AnyUltralisk): 1145 id = UnitTypeId.ULTRALISK 1146 1147 class UltraliskBurrowed(AnyUltralisk): 1148 id = UnitTypeId.ULTRALISK_BURROWED 1149 1150 class UltraliskCavern(ZergStructure): 1151 id = UnitTypeId.ULTRALISK_CAVERN 1152 1153 class VespeneGeyser(AnyVespeneGeyser): 1154 id = UnitTypeId.VESPENE_GEYSER 1155 1156 class VespeneGeyserProtoss(AnyVespeneGeyser): 1157 id = UnitTypeId.VESPENE_GEYSER_PROTOSS 1158 1159 class VespeneGeyserPurifier(AnyVespeneGeyser): 1160 id = UnitTypeId.VESPENE_GEYSER_PURIFIER 1161 1162 class VespeneGeyserRich(AnyVespeneGeyser): 1163 id = UnitTypeId.VESPENE_GEYSER_RICH 1164 1165 class VespeneGeyserShakuras(AnyVespeneGeyser): 1166 id = UnitTypeId.VESPENE_GEYSER_SHAKURAS 1167 1168 class VespeneGeyserSpacePlatform(AnyVespeneGeyser): 1169 id = UnitTypeId.VESPENE_GEYSER_SPACE_PLATFORM 1170 1171 class Viking(AnyViking): 1172 id = UnitTypeId.VIKING 1173 1174 class VikingLanded(AnyViking): 1175 id = UnitTypeId.VIKING_LANDED 1176 1177 class Viper(NonStructure, Zerg): 1178 id = UnitTypeId.VIPER 1179 1180 class VoidRay(StargateUnit): 1181 id = UnitTypeId.VOID_RAY 1182 1183 class WarpGate(AnyGateway): 1184 id = UnitTypeId.WARP_GATE 1185 1186 class WarpPrism(AnyWarpPrism): 1187 id = UnitTypeId.WARP_PRISM 1188 1189 class WarpPrismPhasing(AnyWarpPrism): 1190 id = UnitTypeId.WARP_PRISM_PHASING 1191 1192 class Watchtower(Structure): 1193 id = UnitTypeId.WATCHTOWER 1194 1195 class WidowMine(AnyWidowMine): 1196 id = UnitTypeId.WIDOW_MINE 1197 1198 class WidowMineBurrowed(AnyWidowMine): 1199 id = UnitTypeId.WIDOW_MINE_BURROWED 1200 1201 class Zealot(GatewayUnit): 1202 id = UnitTypeId.ZEALOT 1203 1204 class Zergling(AnyZergling): 1205 id = UnitTypeId.ZERGLING 1206 1207 class ZerglingBurrowed(AnyZergling): 1208 id = UnitTypeId.ZERGLING_BURROWED
Every type of unit, and every group of types, for the type checker. None is ever instantiated.
Unit[UnitType.Marine] is a marine, and Unit[UnitType.ProtossStructure] a Protoss structure. A type's id is its
UnitTypeId. A group is a race, the structures, the types that are not, or the structures of a race, as the game's
tables give them; or the workers, the townhalls, the Terran and the Zerg townhalls, what workers gather at, the
mineral fields, the vespene geysers, the gas buildings, each race's on a plain or a rich geyser, the collapsible
towers and their debris, the destructible rocks, the inhibitor and acceleration zones, the critters, the
changelings, the creep tumors, the locusts, the cocoons, the add-ons, tech labs and reactors, the spires, the
overlords, the units each Terran and Protoss production structure makes, or the two forms of a structure or a unit
that changes and changes back, such as a supply depot raised or lowered, a siege tank sieged or not, or a roach
burrowed or not. Each group is in every group that holds all its types: AnySupplyDepot is a TerranStructure,
AnyDrone a Worker, AnySiegeTank a FactoryUnit, Townhall a Structure, and Worker a NonStructure. A
type's UnitTypeData.equivalent_types is the group of two forms it is in, or else its own class.
includes(unit) tells whether a unit is of a type or group, narrowing it, type_ids holds its ids, and
types_are_equivalent whether a unit converts between its types and back at will.
39 class AnyType: 40 """Any type of unit, and what every type and group is. 41 42 `type[UnitType.AnyType]` takes any of them. `Unit[Any]` is a unit that reads as any type, where 43 `Unit[UnitType.AnyType]` is one whose type the type checker does not know, so a read only some types have is an 44 error on it until `includes` narrows it. 45 """ 46 47 type_ids: ClassVar[frozenset[UnitTypeId]] = frozenset() 48 """The ids this class stands for: a type's own `id`, or those of every type in a group. A type id with no unit 49 is tested against them, as for a structure about to be built: `type_id in UnitType.GasBuilding.type_ids`. A 50 unit is tested by `includes`, which narrows it.""" 51 52 types_are_equivalent: ClassVar[bool] = False 53 """Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and 54 unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as 55 `UnitType.AnySiegeTank`, the `UnitTypeData.equivalent_types` of its types. No class reads False in a group that 56 reads True. Any other group reads False, and a class in it may still read True, as `UnitType.Marine` does in 57 `UnitType.BarracksUnit`.""" 58 59 def __init_subclass__(cls) -> None: 60 """Add the type a class names by its `id` to every group it is in. A class with an `id` is a single type, 61 whose types are equivalent, and one without is a group.""" 62 super().__init_subclass__() 63 type_id: UnitTypeId | None = cls.__dict__.get("id") 64 cls.type_ids = frozenset() if type_id is None else frozenset((type_id,)) 65 if type_id is not None: 66 cls.types_are_equivalent = True 67 # Everything between the class and `object` is a group it is in, `AnyType` included. 68 for group in cast("tuple[type[UnitType.AnyType], ...]", cls.__mro__[1:-1]): 69 group.type_ids |= cls.type_ids 70 71 @overload 72 @classmethod 73 def includes(cls, unit: OwnUnit[Any], /) -> TypeGuard[OwnUnit[Self]]: ... 74 75 @overload 76 @classmethod 77 def includes(cls, unit: Unit[Any], /) -> TypeGuard[Unit[Self]]: ... 78 79 @classmethod 80 def includes(cls, unit: Unit[Any], /) -> bool: 81 """Whether `unit` is of this type, or of a type in this group, narrowing it for the type checker. 82 83 Raises `UncuratedIdError` for a unit of a type the curated ids leave out. 84 """ 85 return unit.type_id in cls.type_ids
Any type of unit, and what every type and group is.
type[UnitType.AnyType] takes any of them. Unit[Any] is a unit that reads as any type, where
Unit[UnitType.AnyType] is one whose type the type checker does not know, so a read only some types have is an
error on it until includes narrows it.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
79 @classmethod 80 def includes(cls, unit: Unit[Any], /) -> bool: 81 """Whether `unit` is of this type, or of a type in this group, narrowing it for the type checker. 82 83 Raises `UncuratedIdError` for a unit of a type the curated ids leave out. 84 """ 85 return unit.type_id in cls.type_ids
Whether unit is of this type, or of a type in this group, narrowing it for the type checker.
Raises UncuratedIdError for a unit of a type the curated ids leave out.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
90 class NonStructure(AnyType): 91 """A type the game's tables do not give the structure attribute."""
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Terran type.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg type.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Protoss type.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
111 class Worker(NonStructure): 112 """A worker: an SCV, a probe or a drone, burrowed or not. A MULE is none."""
A worker: an SCV, a probe or a drone, burrowed or not. A MULE is none.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
114 class Townhall(Structure): 115 """A townhall: a command center or what it becomes, lifted or not, a nexus, a hatchery, lair or hive."""
A townhall: a command center or what it becomes, lifted or not, a nexus, a hatchery, lair or hive.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
117 class AnyTerranTownhall(Townhall, TerranStructure): 118 """A command center or an orbital command, lifted or not, or a planetary fortress."""
A command center or an orbital command, lifted or not, or a planetary fortress.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
120 class AnyZergTownhall(Townhall, ZergStructure): 121 """A Zerg townhall: a hatchery, a lair or a hive."""
A Zerg townhall: a hatchery, a lair or a hive.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
123 class AnyResource(Structure): 124 """What a worker gathers at: a mineral field or a gas building, never the geyser under it."""
What a worker gathers at: a mineral field or a gas building, never the geyser under it.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
126 class AnyMineralField(AnyResource): 127 """A mineral field of any kind: one the game's tables say holds minerals."""
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
129 class AnyVespeneGeyser(Structure): 130 """A vespene geyser of any kind: one the game's tables say holds vespene, of no race."""
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
132 class GasBuilding(AnyResource): 133 """A refinery, an assimilator or an extractor: one the game's tables say holds vespene, of a race."""
A refinery, an assimilator or an extractor: one the game's tables say holds vespene, of a race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
135 class AnyRefinery(GasBuilding, TerranStructure): 136 """A refinery, on a plain or a rich geyser."""
A refinery, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
138 class AnyExtractor(GasBuilding, ZergStructure): 139 """An extractor, on a plain or a rich geyser."""
An extractor, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
141 class AnyAssimilator(GasBuilding, ProtossStructure): 142 """An assimilator, on a plain or a rich geyser."""
An assimilator, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
144 class Destructible(Structure): 145 """A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris."""
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
147 class CollapsibleTower(Destructible): 148 """A collapsible tower, which falls across a path once destroyed and stays there."""
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
150 class CollapsibleTowerDebris(Destructible): 151 """The debris a collapsible tower leaves where it lands once felled."""
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
153 class InhibitorZone(AnyType): 154 """An inhibitor zone generator, of any size, plain or flying."""
An inhibitor zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
156 class AccelerationZone(NonStructure): 157 """An acceleration zone generator, of any size, plain or flying."""
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
159 class Critter(NonStructure): 160 """One of a map's critters: an animal or a robot that wanders and covers no ground."""
One of a map's critters: an animal or a robot that wanders and covers no ground.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
162 class AnyChangeling(NonStructure, Zerg): 163 """A changeling, plain or in the shape of a marine, a zealot or a zergling."""
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
165 class AnyCreepTumor(ZergStructure): 166 """A creep tumor, a queen's or another tumor's, growing or burrowed."""
A creep tumor, a queen's or another tumor's, growing or burrowed.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A locust, on the ground or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
171 class Cocoon(NonStructure, Zerg): 172 """A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling."""
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
174 class AnyAddOn(TerranStructure): 175 """An add-on of any kind: a tech lab or a reactor, attached to its host or plain."""
An add-on of any kind: a tech lab or a reactor, attached to its host or plain.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
177 class AnyTechLab(AnyAddOn): 178 """A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one."""
A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
180 class AnyReactor(AnyAddOn): 181 """A reactor of any kind: a barracks', a factory's or a starport's, or a plain one."""
A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A spire or a greater spire.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
186 class AnyOverlord(NonStructure, Zerg): 187 """An overlord, a transport overlord, or an overseer in either mode, which the tables count as one."""
An overlord, a transport overlord, or an overseer in either mode, which the tables count as one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
189 class BarracksUnit(NonStructure, Terran): 190 """A unit a barracks trains: a marine, a marauder, a reaper or a ghost."""
A unit a barracks trains: a marine, a marauder, a reaper or a ghost.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
192 class FactoryUnit(NonStructure, Terran): 193 """A unit a factory makes, in any form: a hellion or hellbat, a widow mine, siege tank, cyclone or thor."""
A unit a factory makes, in any form: a hellion or hellbat, a widow mine, siege tank, cyclone or thor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
195 class StarportUnit(NonStructure, Terran): 196 """A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser."""
A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
198 class GatewayUnit(NonStructure, Protoss): 199 """A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar."""
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
201 class RoboticsFacilityUnit(NonStructure, Protoss): 202 """A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor."""
A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
204 class StargateUnit(NonStructure, Protoss): 205 """A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier."""
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
207 class AnySupplyDepot(TerranStructure): 208 """A supply depot, raised or lowered.""" 209 210 types_are_equivalent = True
A supply depot, raised or lowered.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
212 class AnyBarracks(TerranStructure): 213 """A barracks, landed or flying.""" 214 215 types_are_equivalent = True
A barracks, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
217 class AnyFactory(TerranStructure): 218 """A factory, landed or flying.""" 219 220 types_are_equivalent = True
A factory, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
222 class AnyStarport(TerranStructure): 223 """A starport, landed or flying.""" 224 225 types_are_equivalent = True
A starport, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
227 class AnyCommandCenter(AnyTerranTownhall): 228 """A command center, landed or flying. An orbital command and a planetary fortress are none.""" 229 230 types_are_equivalent = True
A command center, landed or flying. An orbital command and a planetary fortress are none.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
232 class AnyOrbitalCommand(AnyTerranTownhall): 233 """An orbital command, landed or flying.""" 234 235 types_are_equivalent = True
An orbital command, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
237 class AnyGateway(ProtossStructure): 238 """A gateway or a warp gate.""" 239 240 types_are_equivalent = True
A gateway or a warp gate.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
242 class AnySpineCrawler(ZergStructure): 243 """A spine crawler, rooted or uprooted.""" 244 245 types_are_equivalent = True
A spine crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
247 class AnySporeCrawler(ZergStructure): 248 """A spore crawler, rooted or uprooted.""" 249 250 types_are_equivalent = True
A spore crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
252 class AnyViking(StarportUnit): 253 """A viking, flying or landed.""" 254 255 types_are_equivalent = True
A viking, flying or landed.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
257 class AnySiegeTank(FactoryUnit): 258 """A siege tank, sieged or not.""" 259 260 types_are_equivalent = True
A siege tank, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
262 class AnyWidowMine(FactoryUnit): 263 """A widow mine, burrowed or not.""" 264 265 types_are_equivalent = True
A widow mine, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
267 class AnyLiberator(StarportUnit): 268 """A liberator, sieged or not.""" 269 270 types_are_equivalent = True
A liberator, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
272 class AnyThor(FactoryUnit): 273 """A thor, in either mode.""" 274 275 types_are_equivalent = True
A thor, in either mode.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
277 class AnyHellion(FactoryUnit): 278 """A hellion or a hellbat.""" 279 280 types_are_equivalent = True
A hellion or a hellbat.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
282 class AnyObserver(RoboticsFacilityUnit): 283 """An observer, in surveillance mode or not.""" 284 285 types_are_equivalent = True
An observer, in surveillance mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
287 class AnyOverseer(AnyOverlord): 288 """An overseer, in oversight mode or not.""" 289 290 types_are_equivalent = True
An overseer, in oversight mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
292 class AnyWarpPrism(RoboticsFacilityUnit): 293 """A warp prism, phasing or not.""" 294 295 types_are_equivalent = True
A warp prism, phasing or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
297 class AnyDrone(Worker, Zerg): 298 """A drone, burrowed or not.""" 299 300 types_are_equivalent = True
A drone, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
302 class AnyZergling(NonStructure, Zerg): 303 """A zergling, burrowed or not.""" 304 305 types_are_equivalent = True
A zergling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
307 class AnyBaneling(NonStructure, Zerg): 308 """A baneling, burrowed or not.""" 309 310 types_are_equivalent = True
A baneling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
312 class AnyRoach(NonStructure, Zerg): 313 """A roach, burrowed or not.""" 314 315 types_are_equivalent = True
A roach, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
317 class AnyRavager(NonStructure, Zerg): 318 """A ravager, burrowed or not.""" 319 320 types_are_equivalent = True
A ravager, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
322 class AnyHydralisk(NonStructure, Zerg): 323 """A hydralisk, burrowed or not.""" 324 325 types_are_equivalent = True
A hydralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
327 class AnyLurker(NonStructure, Zerg): 328 """A lurker, burrowed or not.""" 329 330 types_are_equivalent = True
A lurker, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
332 class AnyInfestor(NonStructure, Zerg): 333 """An infestor, burrowed or not.""" 334 335 types_are_equivalent = True
An infestor, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
337 class AnySwarmHost(NonStructure, Zerg): 338 """A swarm host, burrowed or not.""" 339 340 types_are_equivalent = True
A swarm host, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
342 class AnyUltralisk(NonStructure, Zerg): 343 """An ultralisk, burrowed or not.""" 344 345 types_are_equivalent = True
An ultralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
347 class AnyQueen(NonStructure, Zerg): 348 """A queen, burrowed or not.""" 349 350 types_are_equivalent = True
A queen, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
352 class AccelerationZoneFlyingLarge(AccelerationZone): 353 id = UnitTypeId.ACCELERATION_ZONE_FLYING_LARGE
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
355 class AccelerationZoneFlyingMedium(AccelerationZone): 356 id = UnitTypeId.ACCELERATION_ZONE_FLYING_MEDIUM
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
358 class AccelerationZoneFlyingSmall(AccelerationZone): 359 id = UnitTypeId.ACCELERATION_ZONE_FLYING_SMALL
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An acceleration zone generator, of any size, plain or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An assimilator, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An assimilator, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A baneling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A baneling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A barracks, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A barracks, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A changeling, plain or in the shape of a marine, a zealot or a zergling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
448 class CollapsibleTowerDebrisPurifier(CollapsibleTowerDebris): 449 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_PURIFIER
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
451 class CollapsibleTowerDebrisRampLeftRock(CollapsibleTowerDebris): 452 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_LEFT_ROCK
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
454 class CollapsibleTowerDebrisRampLeftRockGreen(CollapsibleTowerDebris): 455 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_LEFT_ROCK_GREEN
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
457 class CollapsibleTowerDebrisRampRightRock(CollapsibleTowerDebris): 458 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_RIGHT_ROCK
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
460 class CollapsibleTowerDebrisRampRightRockGreen(CollapsibleTowerDebris): 461 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_RAMP_RIGHT_ROCK_GREEN
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
463 class CollapsibleTowerDebrisRock(CollapsibleTowerDebris): 464 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_ROCK
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
466 class CollapsibleTowerDebrisTerran(CollapsibleTowerDebris): 467 id = UnitTypeId.COLLAPSIBLE_TOWER_DEBRIS_TERRAN
The debris a collapsible tower leaves where it lands once felled.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
469 class CollapsibleTowerDiagonalPurifier(CollapsibleTower): 470 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_PURIFIER
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
472 class CollapsibleTowerDiagonalRock(CollapsibleTower): 473 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_ROCK
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
475 class CollapsibleTowerDiagonalTerran(CollapsibleTower): 476 id = UnitTypeId.COLLAPSIBLE_TOWER_DIAGONAL_TERRAN
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
478 class CollapsibleTowerPushUnitPurifier(Structure): 479 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_PURIFIER
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
481 class CollapsibleTowerPushUnitRampLeftRock(Structure): 482 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_ROCK
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
484 class CollapsibleTowerPushUnitRampLeftRockGreen(Structure): 485 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_ROCK_GREEN
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
487 class CollapsibleTowerPushUnitRampLeftTerran(Structure): 488 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_LEFT_TERRAN
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
490 class CollapsibleTowerPushUnitRampRightRock(Structure): 491 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_ROCK
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
493 class CollapsibleTowerPushUnitRampRightRockGreen(Structure): 494 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_ROCK_GREEN
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
496 class CollapsibleTowerPushUnitRampRightTerran(Structure): 497 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_RAMP_RIGHT_TERRAN
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
499 class CollapsibleTowerPushUnitRock(Structure): 500 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_ROCK
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
502 class CollapsibleTowerPushUnitTerran(Structure): 503 id = UnitTypeId.COLLAPSIBLE_TOWER_PUSH_UNIT_TERRAN
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
505 class CollapsibleTowerRampLeftRock(CollapsibleTower): 506 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_ROCK
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
508 class CollapsibleTowerRampLeftRockGreen(CollapsibleTower): 509 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_ROCK_GREEN
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
511 class CollapsibleTowerRampLeftTerran(CollapsibleTower): 512 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_LEFT_TERRAN
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
514 class CollapsibleTowerRampRightRock(CollapsibleTower): 515 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_ROCK
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
517 class CollapsibleTowerRampRightRockGreen(CollapsibleTower): 518 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_ROCK_GREEN
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
520 class CollapsibleTowerRampRightTerran(CollapsibleTower): 521 id = UnitTypeId.COLLAPSIBLE_TOWER_RAMP_RIGHT_TERRAN
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A collapsible tower, which falls across a path once destroyed and stays there.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A command center, landed or flying. An orbital command and a planetary fortress are none.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A command center, landed or flying. An orbital command and a planetary fortress are none.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A creep tumor, a queen's or another tumor's, growing or burrowed.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A creep tumor, a queen's or another tumor's, growing or burrowed.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A creep tumor, a queen's or another tumor's, growing or burrowed.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
One of a map's critters: an animal or a robot that wanders and covers no ground.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
One of a map's critters: an animal or a robot that wanders and covers no ground.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a factory makes, in any form: a hellion or hellbat, a widow mine, siege tank, cyclone or thor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
568 class Destructible1x1BraxisAlpha(Destructible): 569 id = UnitTypeId.DESTRUCTIBLE_1X1_BRAXIS_ALPHA
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
571 class Destructible2x2BraxisAlpha(Destructible): 572 id = UnitTypeId.DESTRUCTIBLE_2X2_BRAXIS_ALPHA
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
574 class Destructible2x4HorizontalCityDebris(Destructible): 575 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
577 class Destructible2x4HorizontalIce(Destructible): 578 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
580 class Destructible2x4HorizontalRock(Destructible): 581 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ROCK
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
583 class Destructible2x4HorizontalRockEx1(Destructible): 584 id = UnitTypeId.DESTRUCTIBLE_2X4_HORIZONTAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
586 class Destructible2x4VerticalCityDebris(Destructible): 587 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
589 class Destructible2x4VerticalIce(Destructible): 590 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
592 class Destructible2x4VerticalRock(Destructible): 593 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ROCK
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
595 class Destructible2x4VerticalRockEx1(Destructible): 596 id = UnitTypeId.DESTRUCTIBLE_2X4_VERTICAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
598 class Destructible2x6HorizontalCityDebris(Destructible): 599 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
601 class Destructible2x6HorizontalIce(Destructible): 602 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
604 class Destructible2x6HorizontalRock(Destructible): 605 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ROCK
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
607 class Destructible2x6HorizontalRockEx1(Destructible): 608 id = UnitTypeId.DESTRUCTIBLE_2X6_HORIZONTAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
610 class Destructible2x6VerticalCityDebris(Destructible): 611 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
613 class Destructible2x6VerticalIce(Destructible): 614 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
616 class Destructible2x6VerticalRock(Destructible): 617 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ROCK
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
619 class Destructible2x6VerticalRockEx1(Destructible): 620 id = UnitTypeId.DESTRUCTIBLE_2X6_VERTICAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
622 class Destructible3x3ZergInfestation(Destructible): 623 id = UnitTypeId.DESTRUCTIBLE_3X3_ZERG_INFESTATION
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
646 class Destructible6x6ExpeditionGate(Destructible): 647 id = UnitTypeId.DESTRUCTIBLE_6X6_EXPEDITION_GATE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
661 class DestructibleHugeDiagonalBlurCityDebris(Destructible): 662 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
664 class DestructibleHugeDiagonalBlurDebrisRamp(Destructible): 665 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_DEBRIS_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
667 class DestructibleHugeDiagonalBlurIce(Destructible): 668 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
670 class DestructibleHugeDiagonalBlurRamp(Destructible): 671 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
673 class DestructibleHugeDiagonalBlurRockEx1(Destructible): 674 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_BLUR_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
676 class DestructibleHugeDiagonalUlbrCityDebris(Destructible): 677 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_CITY_DEBRIS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
679 class DestructibleHugeDiagonalUlbrDebrisRamp(Destructible): 680 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_DEBRIS_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
682 class DestructibleHugeDiagonalUlbrIce(Destructible): 683 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
685 class DestructibleHugeDiagonalUlbrRamp(Destructible): 686 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
688 class DestructibleHugeDiagonalUlbrRockEx1(Destructible): 689 id = UnitTypeId.DESTRUCTIBLE_HUGE_DIAGONAL_ULBR_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
691 class DestructibleHugeHorizontalIce(Destructible): 692 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
694 class DestructibleHugeHorizontalRamp(Destructible): 695 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
697 class DestructibleHugeHorizontalRockEx1(Destructible): 698 id = UnitTypeId.DESTRUCTIBLE_HUGE_HORIZONTAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
700 class DestructibleHugeVerticalIce(Destructible): 701 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_ICE
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
703 class DestructibleHugeVerticalRamp(Destructible): 704 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_RAMP
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
706 class DestructibleHugeVerticalRockEx1(Destructible): 707 id = UnitTypeId.DESTRUCTIBLE_HUGE_VERTICAL_ROCK_EX1
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
709 class DestructibleUnbuildableBricks(Destructible): 710 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_BRICKS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
712 class DestructibleUnbuildablePlates(Destructible): 713 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_PLATES
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
715 class DestructibleUnbuildableRocks(Destructible): 716 id = UnitTypeId.DESTRUCTIBLE_UNBUILDABLE_ROCKS
A destructible rock, debris, ice, unbuildable brick, plate or rock, or a collapsible tower or its debris.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A drone, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A drone, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An extractor, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An extractor, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A factory, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A factory, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A gateway or a warp gate.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a barracks trains: a marine, a marauder, a reaper or a ghost.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A spire or a greater spire.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg townhall: a hatchery, a lair or a hive.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A hellion or a hellbat.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A hellion or a hellbat.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg townhall: a hatchery, a lair or a hive.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A hydralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A hydralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a robotics facility makes, in any form: an observer, warp prism, immortal, colossus or disruptor.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An infestor, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An infestor, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
811 class InhibitorZoneFlyingLarge(NonStructure, InhibitorZone): 812 id = UnitTypeId.INHIBITOR_ZONE_FLYING_LARGE
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
814 class InhibitorZoneFlyingMedium(NonStructure, InhibitorZone): 815 id = UnitTypeId.INHIBITOR_ZONE_FLYING_MEDIUM
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
817 class InhibitorZoneFlyingSmall(NonStructure, InhibitorZone): 818 id = UnitTypeId.INHIBITOR_ZONE_FLYING_SMALL
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg townhall: a hatchery, a lair or a hive.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A liberator, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A liberator, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A locust, on the ground or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A locust, on the ground or flying.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A lurker, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A lurker, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a barracks trains: a marine, a marauder, a reaper or a ghost.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a barracks trains: a marine, a marauder, a reaper or a ghost.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
880 class MineralField750BattleStation(AnyMineralField): 881 id = UnitTypeId.MINERAL_FIELD_750_BATTLE_STATION
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
892 class MineralFieldBattleStation(AnyMineralField): 893 id = UnitTypeId.MINERAL_FIELD_BATTLE_STATION
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
910 class MineralFieldRich750Purifier(AnyMineralField): 911 id = UnitTypeId.MINERAL_FIELD_RICH_750_PURIFIER
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
913 class MineralFieldRichPurifier(AnyMineralField): 914 id = UnitTypeId.MINERAL_FIELD_RICH_PURIFIER
A mineral field of any kind: one the game's tables say holds minerals.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An observer, in surveillance mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An observer, in surveillance mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An orbital command, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An orbital command, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An overlord, a transport overlord, or an overseer in either mode, which the tables count as one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An overlord, a transport overlord, or an overseer in either mode, which the tables count as one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An overseer, in oversight mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An overseer, in oversight mode or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
973 class ParasiticBombLeftBehind(NonStructure, Zerg): 974 id = UnitTypeId.PARASITIC_BOMB_LEFT_BEHIND
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A command center or an orbital command, lifted or not, or a planetary fortress.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss type.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A queen, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A queen, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A ravager, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A ravager, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A cocoon or a lurker egg: a unit on its way to becoming another, as a zergling becomes a baneling.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a starport makes, in any form: a viking, medivac, liberator, raven, banshee or battlecruiser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A reactor of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a barracks trains: a marine, a marauder, a reaper or a ghost.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A refinery, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A refinery, on a plain or a rich geyser.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A roach, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A roach, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran type.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Terran structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A siege tank, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A siege tank, sieged or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A spine crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A spine crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A spire or a greater spire.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A spore crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A spore crawler, rooted or uprooted.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A starport, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A starport, landed or flying.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A supply depot, raised or lowered.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A supply depot, raised or lowered.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A swarm host, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A swarm host, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A tech lab of any kind: a barracks', a factory's or a starport's, or a plain one.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A thor, in either mode.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A thor, in either mode.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Protoss structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
An ultralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
An ultralisk, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A Zerg structure.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
1168 class VespeneGeyserSpacePlatform(AnyVespeneGeyser): 1169 id = UnitTypeId.VESPENE_GEYSER_SPACE_PLATFORM
A vespene geyser of any kind: one the game's tables say holds vespene, of no race.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A viking, flying or landed.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A viking, flying or landed.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A type the game's tables do not give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A unit a stargate makes: a phoenix, an oracle, a void ray, a tempest or a carrier.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A gateway or a warp gate.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A warp prism, phasing or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A warp prism, phasing or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A type the game's tables give the structure attribute.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A widow mine, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A widow mine, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A unit a gateway trains or a warp gate warps in: a zealot, stalker, sentry, adept or either templar.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
A zergling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
A zergling, burrowed or not.
Whether a unit converts between any two of this class's types and back at will, as a siege tank sieges and
unsieges. True for a single type, its one type equivalent to itself, and for a group of two forms such as
UnitType.AnySiegeTank, the UnitTypeData.equivalent_types of its types. No class reads False in a group that
reads True. Any other group reads False, and a class in it may still read True, as UnitType.Marine does in
UnitType.BarracksUnit.
The ids this class stands for: a type's own id, or those of every type in a group. A type id with no unit
is tested against them, as for a structure about to be built: type_id in UnitType.GasBuilding.type_ids. A
unit is tested by includes, which narrows it.
9class NotReportedError(NachOSError, LookupError): 10 """The game has not reported what was asked: a field of a unit it has never shown visible, or which start location 11 the enemy took on a map with more than two."""
The game has not reported what was asked: a field of a unit it has never shown visible, or which start location the enemy took on a map with more than two.
111@final 112@dataclass(frozen=True, slots=True) 113class Order: 114 """An order a unit is carrying out or has queued, as the unit reports it. What the bot gave is an 115 `sc2nachos.orders.IssuedOrder`.""" 116 117 ability: AbilityId 118 """The ability ordered.""" 119 _target: Target | Literal[_NotReported.TARGET] | None 120 progress: float 121 """The order's progress from 0 to 1 for a train, a research or a larva's morph, and 0 otherwise: any other morph 122 and an add-on read 0 until they are done (in game). `Unit.morph_progress` works out a structure's or a cocoon's 123 morph, and an add-on reports its own `build_progress`.""" 124 125 @property 126 def target(self) -> Target | None: 127 """The point or unit the order is aimed at, or `None` for an order that takes neither. 128 129 An order aimed at a unit the game names under a tag it never reports, as an SCV's gather is while it walks 130 back to a mineral field out of sight (in game), reads as aimed at the unit the same unit's last order of the 131 same ability named, a unit dead since among them. Raises `NotReportedError` if there was none. 132 """ 133 if self._target is _NotReported.TARGET: 134 raise NotReportedError(f"the game names the unit this {self.ability.name} is aimed at by no tag it reports") 135 return self._target 136 137 @property 138 def known_target(self) -> Target | None: 139 """`target`, or `None` where `target` raises: for an order aimed at a unit the game names by a tag it never 140 reports, with no earlier order of the same ability to read it from. `None` also for an order aimed at nothing; 141 `target` tells the two apart.""" 142 return None if self._target is _NotReported.TARGET else self._target 143 144 @classmethod 145 def _from_proto( 146 cls, order: raw_pb2.UnitOrder, unit_target_of_order: Callable[[raw_pb2.UnitOrder], Unit[Any] | None] 147 ) -> Self: 148 """Read an order a unit reported, finding the unit it is aimed at through `unit_target_of_order`.""" 149 match order.WhichOneof("target"): 150 case "target_world_space_pos": 151 target: Target | Literal[_NotReported.TARGET] | None = _target_point(order.target_world_space_pos) 152 case "target_unit_tag": 153 unit = unit_target_of_order(order) 154 target = _NotReported.TARGET if unit is None else unit 155 case _: 156 target = None 157 return cls(AbilityId.read(order.ability_id), target, order.progress)
An order a unit is carrying out or has queued, as the unit reports it. What the bot gave is an
sc2nachos.orders.IssuedOrder.
The order's progress from 0 to 1 for a train, a research or a larva's morph, and 0 otherwise: any other morph
and an add-on read 0 until they are done (in game). Unit.morph_progress works out a structure's or a cocoon's
morph, and an add-on reports its own build_progress.
125 @property 126 def target(self) -> Target | None: 127 """The point or unit the order is aimed at, or `None` for an order that takes neither. 128 129 An order aimed at a unit the game names under a tag it never reports, as an SCV's gather is while it walks 130 back to a mineral field out of sight (in game), reads as aimed at the unit the same unit's last order of the 131 same ability named, a unit dead since among them. Raises `NotReportedError` if there was none. 132 """ 133 if self._target is _NotReported.TARGET: 134 raise NotReportedError(f"the game names the unit this {self.ability.name} is aimed at by no tag it reports") 135 return self._target
The point or unit the order is aimed at, or None for an order that takes neither.
An order aimed at a unit the game names under a tag it never reports, as an SCV's gather is while it walks
back to a mineral field out of sight (in game), reads as aimed at the unit the same unit's last order of the
same ability named, a unit dead since among them. Raises NotReportedError if there was none.
137 @property 138 def known_target(self) -> Target | None: 139 """`target`, or `None` where `target` raises: for an order aimed at a unit the game names by a tag it never 140 reports, with no earlier order of the same ability to read it from. `None` also for an order aimed at nothing; 141 `target` tells the two apart.""" 142 return None if self._target is _NotReported.TARGET else self._target
25class OwnUnit[K: UnitType.AnyType](Unit[K]): 26 """One of this player's units. It also reads what the game reports only to a unit's owner. 27 28 A unit changes between `Unit` and `OwnUnit` in place when it changes sides, as under a neural parasite. 29 """ 30 31 __slots__ = () 32 33 def issue( 34 self, 35 ability: AbilityId, 36 *, 37 target: PointLike | Unit[Any] | None = None, 38 queued: bool = False, 39 force: bool = False, 40 ) -> IssuedOrder: 41 """Order the unit to use `ability`, aimed at a point, a unit or nothing, and return the `IssuedOrder`, as 42 `sc2nachos.orders.OrderBook.issue` orders it: `unit.issue(AbilityId.MOVE, target=point)` is 43 `api.orders.issue(unit, AbilityId.MOVE, target=point)`. 44 45 Raises as `OrderBook.issue` does. 46 """ 47 return self._tracker.order_book.issue(self, ability, target=target, queued=queued, force=force) 48 49 def train( 50 self: OwnUnit[UnitType.Structure | UnitType.Larva], 51 unit_type: UnitTypeId, 52 *, 53 target: PointLike | Unit[Any] | None = None, 54 queued: bool = False, 55 force: bool = False, 56 ) -> IssuedOrder: 57 """Order the structure or larva to make a unit of `unit_type` and return the `IssuedOrder`, as 58 `sc2nachos.orders.OrderBook.train` orders it: `barracks.train(UnitTypeId.MARINE)` is 59 `api.orders.train(barracks, UnitTypeId.MARINE)`. 60 61 Raises as `OrderBook.train` does. 62 """ 63 return self._tracker.order_book.train(self, unit_type, target=target, queued=queued, force=force) 64 65 def build( 66 self: OwnUnit[UnitType.Worker | UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport], 67 unit_type: UnitTypeId, 68 *, 69 target: PointLike | Unit[Any] | None = None, 70 queued: bool = False, 71 force: bool = False, 72 ) -> IssuedOrder: 73 """Order the worker to make a structure of `unit_type`, or the barracks, factory or starport its add-on, and 74 return the `IssuedOrder`, as `sc2nachos.orders.OrderBook.build` orders it: `scv.build(UnitTypeId.BUNKER, 75 target=site)` is `api.orders.build(scv, UnitTypeId.BUNKER, target=site)`. 76 77 Raises as `OrderBook.build` does. 78 """ 79 return self._tracker.order_book.build(self, unit_type, target=target, queued=queued, force=force) 80 81 def research( 82 self: OwnUnit[UnitType.Structure], upgrade: UpgradeId, *, queued: bool = False, force: bool = False 83 ) -> IssuedOrder: 84 """Order the structure to research `upgrade` and return the `IssuedOrder`, as 85 `sc2nachos.orders.OrderBook.research` orders it: `tech_lab.research(UpgradeId.STIMPACK)` is 86 `api.orders.research(tech_lab, UpgradeId.STIMPACK)`. 87 88 Raises as `OrderBook.research` does: `ValueError` for a barracks given one of its tech lab's upgrades. 89 """ 90 return self._tracker.order_book.research(self, upgrade, queued=queued, force=force) 91 92 @property 93 def orders(self) -> tuple[Order, ...]: 94 """The unit's current order, then its queued orders.""" 95 update = self._tracker.last_changes.update 96 # Read off the snapshot's fields rather than through `at`, to spare a call on the common path. 97 if (cached := self._orders).update == update: 98 return cached.value 99 reported = self._latest_report.orders 100 orders = tuple(Order._from_proto(order, self._unit_target_of_order) for order in reported) 101 self._orders = _Snapshot(orders, update) 102 return orders 103 104 @property 105 def current_order(self) -> Order | None: 106 """The order the unit is carrying out, the first of `orders`, or `None` for an idle unit.""" 107 orders = self.orders 108 return orders[0] if orders else None 109 110 def _unit_target_of_order(self, order: raw_pb2.UnitOrder) -> Unit[Any] | None: 111 """The unit `order` names: the one the game reported under its tag, or, for a tag the game never reports, the 112 one this unit's last order of the same ability named under a tag it did; `None` if there is none.""" 113 unit = self._tracker.unit_tracker.get_by_tag(order.target_unit_tag) 114 if unit is None and self._order_targets is not None: 115 unit = self._order_targets.get(order.ability_id) 116 return unit 117 118 @property 119 def is_idle(self) -> bool: 120 """Whether the unit has no orders.""" 121 return not self._latest_report.orders 122 123 def is_doing(self, abilities: AbilityId | Collection[AbilityId]) -> bool: 124 """Whether the unit's `current_order` carries out `abilities`, one ability or any of several. False for an idle 125 unit.""" 126 # Read off the report: building `orders` to read the first would read every order and look up its target. 127 if not (reported_orders := self._latest_report.orders): 128 return False 129 ability_id = AbilityId.read(reported_orders[0].ability_id) 130 if isinstance(abilities, AbilityId): 131 return ability_id == abilities 132 return ability_id in abilities 133 134 @property 135 def is_moving(self) -> bool: 136 """Whether the unit's current order is a move.""" 137 return self.is_doing(AbilityId.MOVE) 138 139 @property 140 def is_attacking(self) -> bool: 141 """Whether the unit's current order is an attack, on a unit or a point, an attack-move reading as one.""" 142 return self.is_doing(AbilityId.ATTACK) 143 144 @property 145 def is_gathering(self) -> bool: 146 """Whether the unit's current order is a gather.""" 147 return self.is_doing(AbilityId.GATHER) 148 149 @property 150 def is_returning(self) -> bool: 151 """Whether the unit's current order is a return of what it carries.""" 152 return self.is_doing(AbilityId.RETURN) 153 154 @property 155 def is_repairing(self) -> bool: 156 """Whether the unit's current order is a repair.""" 157 return self.is_doing(AbilityId.REPAIR) 158 159 @property 160 def is_constructing(self) -> bool: 161 """Whether the unit builds a structure, or walks to the site of one it was ordered to build: it has a 162 `construction`, or its current order's ability places a structure, a barracks building its add-on and a queen 163 placing a creep tumor among them.""" 164 return self.construction is not None or self.is_doing(self._tracker.game_data._placing_abilities) 165 166 @property 167 def weapon_cooldown(self) -> GameTime: 168 """The time until the unit can attack again, as the game reports it: the cooldown of its last attack, with the 169 random delay drawn for it, counting down one step each step. Zero for a unit without a weapon; `weapons` says 170 whether it can attack at all. 171 172 It reads 0 too while an attack is under way, for 0 to 6 steps before it by type and up to 8 for an ultralisk, 173 and a move ordered 2 steps or more before the attack cancels it, 1 step before it does not (in game). So a unit 174 that moves between attacks keeps each by waiting for the cooldown to rise, in the step of the attack. 175 `docs/reference/game-behavior/damage-and-buffs.md` has the steps each type reads 0. 176 """ 177 return GameTime(steps=self._latest_report.weapon_cooldown) 178 179 @property 180 def buff_duration_max(self) -> GameTime | None: 181 """The whole length of the unit's timed life, as a MULE's or a broodling's, or of a timed buff on it, as a 182 hatchery's inject timer, as the game reports it; `None` where it reports none, as for a worker or a townhall 183 (in game; corpus).""" 184 maximum = self._latest_report.buff_duration_max 185 return GameTime(steps=maximum) if maximum else None 186 187 @property 188 def buff_duration_remaining(self) -> GameTime | None: 189 """What is left of `buff_duration_max`, counting down a step at a time; `None` where `buff_duration_max` is. 190 191 It reads zero, not `None`, once run out. It can start above the maximum: a MULE read 1441 and 1443 steps against 192 1440, and a broodling up to 132 against 128. A MULE or a broodling is listed last at zero, against its maximum, 193 and reported dead the step after (in game). 194 `docs/reference/game-behavior/units.md` has the readings. 195 """ 196 report = self._latest_report 197 return GameTime(steps=report.buff_duration_remain) if report.buff_duration_max else None 198 199 @property 200 def assigned_harvesters(self: OwnUnit[UnitType.Townhall | UnitType.GasBuilding]) -> int: 201 """The workers mining a town hall's minerals or a gas building's vespene. 0 for anything else.""" 202 return self._latest_report.assigned_harvesters 203 204 @property 205 def ideal_harvesters(self: OwnUnit[UnitType.Townhall | UnitType.GasBuilding]) -> int: 206 """The workers a town hall or gas building can use before another adds nothing: 2 per field, 3 per geyser.""" 207 return self._latest_report.ideal_harvesters 208 209 @property 210 def passengers(self) -> tuple[Passenger, ...]: 211 """The units inside the unit.""" 212 unit_by_tag = self._tracker.unit_tracker.by_tag 213 return tuple(Passenger._from_proto(passenger, unit_by_tag) for passenger in self._latest_report.passengers) 214 215 @property 216 def cargo_used(self) -> int: 217 """The cargo slots the passengers fill.""" 218 return self._latest_report.cargo_space_taken 219 220 @property 221 def cargo_max(self) -> int: 222 """The unit's cargo slots. 0 for a unit that carries nothing.""" 223 return self._latest_report.cargo_space_max 224 225 @property 226 def rally_targets(self) -> tuple[RallyTarget, ...]: 227 """Where a structure, an egg or a cocoon sends what it makes. Empty for anything else.""" 228 unit_by_tag = self._tracker.unit_tracker.by_tag 229 return tuple(RallyTarget._from_proto(rally, unit_by_tag) for rally in self._latest_report.rally_targets) 230 231 @property 232 def is_weapon_ready(self) -> bool: 233 """Whether the unit has a weapon and its `weapon_cooldown` is zero: it can attack now, or is under way with an 234 attack, whose cooldown reads zero until it fires (in game). Its weapons are its `active_weapons`, which an 235 oracle whose beam is off has none of.""" 236 return bool(self.active_weapons) and not self.weapon_cooldown 237 238 @property 239 def has_reactor(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> bool: 240 """Whether a finished reactor is attached to a barracks, factory or starport.""" 241 return self._has_add_on_of(UnitType.AnyReactor) 242 243 @property 244 def has_tech_lab(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> bool: 245 """Whether a finished tech lab is attached to a barracks, factory or starport.""" 246 return self._has_add_on_of(UnitType.AnyTechLab) 247 248 @property 249 def production_capacity(self) -> int: 250 """How many units the unit trains at once: 2 for a structure with a reactor, 1 for another structure the 251 game's tables give as a maker of a unit, and 0 for anything else, an SCV and a larva among them, which make no 252 unit from a queue. A warp gate reads 1, though it warps in without one. Whether the structure is finished is 253 left out. A reactor counts once finished, since the game names a structure's add-on only then (in game): a 254 barracks building its reactor reads 1.""" 255 if self.type_id not in self._tracker.game_data._unit_trainers: 256 return 0 257 return 2 if self._has_add_on_of(UnitType.AnyReactor) else 1 258 259 @property 260 def add_on(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> OwnUnit[Any] | None: 261 """The finished add-on of a barracks, factory or starport, or `None`, as while the add-on is built, when it is 262 the host's `construction` (in game).""" 263 return self._attached_add_on 264 265 @property 266 def _attached_add_on(self) -> OwnUnit[Any] | None: 267 """The unit's add-on, or `None`, whatever its type.""" 268 tag = self._latest_report.add_on_tag 269 # An add-on is its structure's owner's. 270 return cast("OwnUnit[Any]", self._tracker.unit_tracker.by_tag(tag)) if tag else None 271 272 def _has_add_on_of(self, add_on_type: type[UnitType.AnyAddOn]) -> bool: 273 """Whether an add-on of `add_on_type`, a type or a group, is attached to the unit, whatever its type.""" 274 add_on = self._attached_add_on 275 return add_on is not None and add_on_type.includes(add_on) 276 277 @property 278 def engaged_target(self) -> Unit[Any] | None: 279 """The unit this unit is attacking, which may be dead or gone out of the observation, or `None`. Also `None` for 280 a target no observation listed, such as a unit created and killed within a step (in game).""" 281 tag = self._latest_report.engaged_target_tag 282 return self._tracker.unit_tracker.get_by_tag(tag) if tag else None 283 284 @property 285 def construction(self) -> OwnUnit[Any] | None: 286 """The unfinished structure the unit is building, a barracks's, factory's or starport's add-on among them, or 287 the one a drone became until it finishes, or `None`, as for a dead unit.""" 288 return self._tracker.builder_tracker.structure_built_by(self) 289 290 @property 291 def builder(self: OwnUnit[UnitType.Structure]) -> OwnUnit[Any] | None: 292 """The unit building this structure, an SCV, a queen planting a creep tumor or an add-on's host, or the drone 293 that became it; `None` for a structure nobody is building: one halted, one warped in, or one finished.""" 294 return self._tracker.builder_tracker.builder_of(self)
One of this player's units. It also reads what the game reports only to a unit's owner.
A unit changes between Unit and OwnUnit in place when it changes sides, as under a neural parasite.
33 def issue( 34 self, 35 ability: AbilityId, 36 *, 37 target: PointLike | Unit[Any] | None = None, 38 queued: bool = False, 39 force: bool = False, 40 ) -> IssuedOrder: 41 """Order the unit to use `ability`, aimed at a point, a unit or nothing, and return the `IssuedOrder`, as 42 `sc2nachos.orders.OrderBook.issue` orders it: `unit.issue(AbilityId.MOVE, target=point)` is 43 `api.orders.issue(unit, AbilityId.MOVE, target=point)`. 44 45 Raises as `OrderBook.issue` does. 46 """ 47 return self._tracker.order_book.issue(self, ability, target=target, queued=queued, force=force)
Order the unit to use ability, aimed at a point, a unit or nothing, and return the IssuedOrder, as
sc2nachos.orders.OrderBook.issue orders it: unit.issue(AbilityId.MOVE, target=point) is
api.orders.issue(unit, AbilityId.MOVE, target=point).
Raises as OrderBook.issue does.
49 def train( 50 self: OwnUnit[UnitType.Structure | UnitType.Larva], 51 unit_type: UnitTypeId, 52 *, 53 target: PointLike | Unit[Any] | None = None, 54 queued: bool = False, 55 force: bool = False, 56 ) -> IssuedOrder: 57 """Order the structure or larva to make a unit of `unit_type` and return the `IssuedOrder`, as 58 `sc2nachos.orders.OrderBook.train` orders it: `barracks.train(UnitTypeId.MARINE)` is 59 `api.orders.train(barracks, UnitTypeId.MARINE)`. 60 61 Raises as `OrderBook.train` does. 62 """ 63 return self._tracker.order_book.train(self, unit_type, target=target, queued=queued, force=force)
Order the structure or larva to make a unit of unit_type and return the IssuedOrder, as
sc2nachos.orders.OrderBook.train orders it: barracks.train(UnitTypeId.MARINE) is
api.orders.train(barracks, UnitTypeId.MARINE).
Raises as OrderBook.train does.
65 def build( 66 self: OwnUnit[UnitType.Worker | UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport], 67 unit_type: UnitTypeId, 68 *, 69 target: PointLike | Unit[Any] | None = None, 70 queued: bool = False, 71 force: bool = False, 72 ) -> IssuedOrder: 73 """Order the worker to make a structure of `unit_type`, or the barracks, factory or starport its add-on, and 74 return the `IssuedOrder`, as `sc2nachos.orders.OrderBook.build` orders it: `scv.build(UnitTypeId.BUNKER, 75 target=site)` is `api.orders.build(scv, UnitTypeId.BUNKER, target=site)`. 76 77 Raises as `OrderBook.build` does. 78 """ 79 return self._tracker.order_book.build(self, unit_type, target=target, queued=queued, force=force)
Order the worker to make a structure of unit_type, or the barracks, factory or starport its add-on, and
return the IssuedOrder, as sc2nachos.orders.OrderBook.build orders it: scv.build(UnitTypeId.BUNKER,
target=site) is api.orders.build(scv, UnitTypeId.BUNKER, target=site).
Raises as OrderBook.build does.
81 def research( 82 self: OwnUnit[UnitType.Structure], upgrade: UpgradeId, *, queued: bool = False, force: bool = False 83 ) -> IssuedOrder: 84 """Order the structure to research `upgrade` and return the `IssuedOrder`, as 85 `sc2nachos.orders.OrderBook.research` orders it: `tech_lab.research(UpgradeId.STIMPACK)` is 86 `api.orders.research(tech_lab, UpgradeId.STIMPACK)`. 87 88 Raises as `OrderBook.research` does: `ValueError` for a barracks given one of its tech lab's upgrades. 89 """ 90 return self._tracker.order_book.research(self, upgrade, queued=queued, force=force)
Order the structure to research upgrade and return the IssuedOrder, as
sc2nachos.orders.OrderBook.research orders it: tech_lab.research(UpgradeId.STIMPACK) is
api.orders.research(tech_lab, UpgradeId.STIMPACK).
Raises as OrderBook.research does: ValueError for a barracks given one of its tech lab's upgrades.
92 @property 93 def orders(self) -> tuple[Order, ...]: 94 """The unit's current order, then its queued orders.""" 95 update = self._tracker.last_changes.update 96 # Read off the snapshot's fields rather than through `at`, to spare a call on the common path. 97 if (cached := self._orders).update == update: 98 return cached.value 99 reported = self._latest_report.orders 100 orders = tuple(Order._from_proto(order, self._unit_target_of_order) for order in reported) 101 self._orders = _Snapshot(orders, update) 102 return orders
The unit's current order, then its queued orders.
104 @property 105 def current_order(self) -> Order | None: 106 """The order the unit is carrying out, the first of `orders`, or `None` for an idle unit.""" 107 orders = self.orders 108 return orders[0] if orders else None
The order the unit is carrying out, the first of orders, or None for an idle unit.
118 @property 119 def is_idle(self) -> bool: 120 """Whether the unit has no orders.""" 121 return not self._latest_report.orders
Whether the unit has no orders.
123 def is_doing(self, abilities: AbilityId | Collection[AbilityId]) -> bool: 124 """Whether the unit's `current_order` carries out `abilities`, one ability or any of several. False for an idle 125 unit.""" 126 # Read off the report: building `orders` to read the first would read every order and look up its target. 127 if not (reported_orders := self._latest_report.orders): 128 return False 129 ability_id = AbilityId.read(reported_orders[0].ability_id) 130 if isinstance(abilities, AbilityId): 131 return ability_id == abilities 132 return ability_id in abilities
Whether the unit's current_order carries out abilities, one ability or any of several. False for an idle
unit.
134 @property 135 def is_moving(self) -> bool: 136 """Whether the unit's current order is a move.""" 137 return self.is_doing(AbilityId.MOVE)
Whether the unit's current order is a move.
139 @property 140 def is_attacking(self) -> bool: 141 """Whether the unit's current order is an attack, on a unit or a point, an attack-move reading as one.""" 142 return self.is_doing(AbilityId.ATTACK)
Whether the unit's current order is an attack, on a unit or a point, an attack-move reading as one.
144 @property 145 def is_gathering(self) -> bool: 146 """Whether the unit's current order is a gather.""" 147 return self.is_doing(AbilityId.GATHER)
Whether the unit's current order is a gather.
149 @property 150 def is_returning(self) -> bool: 151 """Whether the unit's current order is a return of what it carries.""" 152 return self.is_doing(AbilityId.RETURN)
Whether the unit's current order is a return of what it carries.
154 @property 155 def is_repairing(self) -> bool: 156 """Whether the unit's current order is a repair.""" 157 return self.is_doing(AbilityId.REPAIR)
Whether the unit's current order is a repair.
159 @property 160 def is_constructing(self) -> bool: 161 """Whether the unit builds a structure, or walks to the site of one it was ordered to build: it has a 162 `construction`, or its current order's ability places a structure, a barracks building its add-on and a queen 163 placing a creep tumor among them.""" 164 return self.construction is not None or self.is_doing(self._tracker.game_data._placing_abilities)
Whether the unit builds a structure, or walks to the site of one it was ordered to build: it has a
construction, or its current order's ability places a structure, a barracks building its add-on and a queen
placing a creep tumor among them.
166 @property 167 def weapon_cooldown(self) -> GameTime: 168 """The time until the unit can attack again, as the game reports it: the cooldown of its last attack, with the 169 random delay drawn for it, counting down one step each step. Zero for a unit without a weapon; `weapons` says 170 whether it can attack at all. 171 172 It reads 0 too while an attack is under way, for 0 to 6 steps before it by type and up to 8 for an ultralisk, 173 and a move ordered 2 steps or more before the attack cancels it, 1 step before it does not (in game). So a unit 174 that moves between attacks keeps each by waiting for the cooldown to rise, in the step of the attack. 175 `docs/reference/game-behavior/damage-and-buffs.md` has the steps each type reads 0. 176 """ 177 return GameTime(steps=self._latest_report.weapon_cooldown)
The time until the unit can attack again, as the game reports it: the cooldown of its last attack, with the
random delay drawn for it, counting down one step each step. Zero for a unit without a weapon; weapons says
whether it can attack at all.
It reads 0 too while an attack is under way, for 0 to 6 steps before it by type and up to 8 for an ultralisk,
and a move ordered 2 steps or more before the attack cancels it, 1 step before it does not (in game). So a unit
that moves between attacks keeps each by waiting for the cooldown to rise, in the step of the attack.
docs/reference/game-behavior/damage-and-buffs.md has the steps each type reads 0.
179 @property 180 def buff_duration_max(self) -> GameTime | None: 181 """The whole length of the unit's timed life, as a MULE's or a broodling's, or of a timed buff on it, as a 182 hatchery's inject timer, as the game reports it; `None` where it reports none, as for a worker or a townhall 183 (in game; corpus).""" 184 maximum = self._latest_report.buff_duration_max 185 return GameTime(steps=maximum) if maximum else None
The whole length of the unit's timed life, as a MULE's or a broodling's, or of a timed buff on it, as a
hatchery's inject timer, as the game reports it; None where it reports none, as for a worker or a townhall
(in game; corpus).
187 @property 188 def buff_duration_remaining(self) -> GameTime | None: 189 """What is left of `buff_duration_max`, counting down a step at a time; `None` where `buff_duration_max` is. 190 191 It reads zero, not `None`, once run out. It can start above the maximum: a MULE read 1441 and 1443 steps against 192 1440, and a broodling up to 132 against 128. A MULE or a broodling is listed last at zero, against its maximum, 193 and reported dead the step after (in game). 194 `docs/reference/game-behavior/units.md` has the readings. 195 """ 196 report = self._latest_report 197 return GameTime(steps=report.buff_duration_remain) if report.buff_duration_max else None
What is left of buff_duration_max, counting down a step at a time; None where buff_duration_max is.
It reads zero, not None, once run out. It can start above the maximum: a MULE read 1441 and 1443 steps against
1440, and a broodling up to 132 against 128. A MULE or a broodling is listed last at zero, against its maximum,
and reported dead the step after (in game).
docs/reference/game-behavior/units.md has the readings.
199 @property 200 def assigned_harvesters(self: OwnUnit[UnitType.Townhall | UnitType.GasBuilding]) -> int: 201 """The workers mining a town hall's minerals or a gas building's vespene. 0 for anything else.""" 202 return self._latest_report.assigned_harvesters
The workers mining a town hall's minerals or a gas building's vespene. 0 for anything else.
204 @property 205 def ideal_harvesters(self: OwnUnit[UnitType.Townhall | UnitType.GasBuilding]) -> int: 206 """The workers a town hall or gas building can use before another adds nothing: 2 per field, 3 per geyser.""" 207 return self._latest_report.ideal_harvesters
The workers a town hall or gas building can use before another adds nothing: 2 per field, 3 per geyser.
209 @property 210 def passengers(self) -> tuple[Passenger, ...]: 211 """The units inside the unit.""" 212 unit_by_tag = self._tracker.unit_tracker.by_tag 213 return tuple(Passenger._from_proto(passenger, unit_by_tag) for passenger in self._latest_report.passengers)
The units inside the unit.
215 @property 216 def cargo_used(self) -> int: 217 """The cargo slots the passengers fill.""" 218 return self._latest_report.cargo_space_taken
The cargo slots the passengers fill.
220 @property 221 def cargo_max(self) -> int: 222 """The unit's cargo slots. 0 for a unit that carries nothing.""" 223 return self._latest_report.cargo_space_max
The unit's cargo slots. 0 for a unit that carries nothing.
225 @property 226 def rally_targets(self) -> tuple[RallyTarget, ...]: 227 """Where a structure, an egg or a cocoon sends what it makes. Empty for anything else.""" 228 unit_by_tag = self._tracker.unit_tracker.by_tag 229 return tuple(RallyTarget._from_proto(rally, unit_by_tag) for rally in self._latest_report.rally_targets)
Where a structure, an egg or a cocoon sends what it makes. Empty for anything else.
231 @property 232 def is_weapon_ready(self) -> bool: 233 """Whether the unit has a weapon and its `weapon_cooldown` is zero: it can attack now, or is under way with an 234 attack, whose cooldown reads zero until it fires (in game). Its weapons are its `active_weapons`, which an 235 oracle whose beam is off has none of.""" 236 return bool(self.active_weapons) and not self.weapon_cooldown
Whether the unit has a weapon and its weapon_cooldown is zero: it can attack now, or is under way with an
attack, whose cooldown reads zero until it fires (in game). Its weapons are its active_weapons, which an
oracle whose beam is off has none of.
238 @property 239 def has_reactor(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> bool: 240 """Whether a finished reactor is attached to a barracks, factory or starport.""" 241 return self._has_add_on_of(UnitType.AnyReactor)
Whether a finished reactor is attached to a barracks, factory or starport.
243 @property 244 def has_tech_lab(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> bool: 245 """Whether a finished tech lab is attached to a barracks, factory or starport.""" 246 return self._has_add_on_of(UnitType.AnyTechLab)
Whether a finished tech lab is attached to a barracks, factory or starport.
248 @property 249 def production_capacity(self) -> int: 250 """How many units the unit trains at once: 2 for a structure with a reactor, 1 for another structure the 251 game's tables give as a maker of a unit, and 0 for anything else, an SCV and a larva among them, which make no 252 unit from a queue. A warp gate reads 1, though it warps in without one. Whether the structure is finished is 253 left out. A reactor counts once finished, since the game names a structure's add-on only then (in game): a 254 barracks building its reactor reads 1.""" 255 if self.type_id not in self._tracker.game_data._unit_trainers: 256 return 0 257 return 2 if self._has_add_on_of(UnitType.AnyReactor) else 1
How many units the unit trains at once: 2 for a structure with a reactor, 1 for another structure the game's tables give as a maker of a unit, and 0 for anything else, an SCV and a larva among them, which make no unit from a queue. A warp gate reads 1, though it warps in without one. Whether the structure is finished is left out. A reactor counts once finished, since the game names a structure's add-on only then (in game): a barracks building its reactor reads 1.
259 @property 260 def add_on(self: OwnUnit[UnitType.AnyBarracks | UnitType.AnyFactory | UnitType.AnyStarport]) -> OwnUnit[Any] | None: 261 """The finished add-on of a barracks, factory or starport, or `None`, as while the add-on is built, when it is 262 the host's `construction` (in game).""" 263 return self._attached_add_on
The finished add-on of a barracks, factory or starport, or None, as while the add-on is built, when it is
the host's construction (in game).
277 @property 278 def engaged_target(self) -> Unit[Any] | None: 279 """The unit this unit is attacking, which may be dead or gone out of the observation, or `None`. Also `None` for 280 a target no observation listed, such as a unit created and killed within a step (in game).""" 281 tag = self._latest_report.engaged_target_tag 282 return self._tracker.unit_tracker.get_by_tag(tag) if tag else None
The unit this unit is attacking, which may be dead or gone out of the observation, or None. Also None for
a target no observation listed, such as a unit created and killed within a step (in game).
284 @property 285 def construction(self) -> OwnUnit[Any] | None: 286 """The unfinished structure the unit is building, a barracks's, factory's or starport's add-on among them, or 287 the one a drone became until it finishes, or `None`, as for a dead unit.""" 288 return self._tracker.builder_tracker.structure_built_by(self)
The unfinished structure the unit is building, a barracks's, factory's or starport's add-on among them, or
the one a drone became until it finishes, or None, as for a dead unit.
290 @property 291 def builder(self: OwnUnit[UnitType.Structure]) -> OwnUnit[Any] | None: 292 """The unit building this structure, an SCV, a queen planting a creep tumor or an add-on's host, or the drone 293 that became it; `None` for a structure nobody is building: one halted, one warped in, or one finished.""" 294 return self._tracker.builder_tracker.builder_of(self)
The unit building this structure, an SCV, a queen planting a creep tumor or an add-on's host, or the drone
that became it; None for a structure nobody is building: one halted, one warped in, or one finished.
178@final 179@dataclass(frozen=True, slots=True) 180class Passenger: 181 """A unit inside a transport, bunker or other unit that holds units, as the unit holding it reports it.""" 182 183 unit: Unit[Any] 184 """The unit itself. It is unlisted while inside, and reads as it was when it went in.""" 185 type_id: UnitTypeId 186 health: float 187 health_max: float 188 shield: float 189 shield_max: float 190 energy: float 191 energy_max: float 192 193 @classmethod 194 def _from_proto(cls, passenger: raw_pb2.PassengerUnit, unit_by_tag: Callable[[int], Unit[Any]]) -> Self: 195 """Read a passenger a transport reported, looking up the unit through `unit_by_tag`.""" 196 return cls( 197 unit=unit_by_tag(passenger.tag), 198 type_id=UnitTypeId.read(passenger.unit_type), 199 health=passenger.health, 200 health_max=passenger.health_max, 201 shield=passenger.shield, 202 shield_max=passenger.shield_max, 203 energy=passenger.energy, 204 energy_max=passenger.energy_max, 205 )
A unit inside a transport, bunker or other unit that holds units, as the unit holding it reports it.
The unit itself. It is unlisted while inside, and reads as it was when it went in.
15@dataclass(frozen=True, slots=True) 16class Progress[T: UnitTypeId | UpgradeId]: 17 """How far the making of one unit or upgrade has got: what it makes, how much of it is done and how long it has 18 left. `InProduction` and `Research` are each one, with what makes it.""" 19 20 product: T 21 """What is being made.""" 22 fraction: float 23 """How far along it is, from 0 to 1.""" 24 total_time: GameTime 25 """The time the whole of it takes, a whole number of steps.""" 26 time_left: GameTime 27 """The time until it is done, a whole number of steps."""
How far the making of one unit or upgrade has got: what it makes, how much of it is done and how long it has
left. InProduction and Research are each one, with what makes it.
160@final 161@dataclass(frozen=True, slots=True) 162class RallyTarget: 163 """Where a structure sends what it makes.""" 164 165 target: Target 166 """The unit rallied to, or the point: a spot on the ground, or where a unit now gone or out of sight stands or 167 stood.""" 168 169 @classmethod 170 def _from_proto(cls, rally: raw_pb2.RallyTarget, unit_by_tag: Callable[[int], Unit[Any]]) -> Self: 171 """Read a rally point a structure reported, looking up a unit target through `unit_by_tag`.""" 172 tag = rally.tag 173 if rally.HasField("tag") and tag != _NO_UNIT: 174 return cls(unit_by_tag(tag)) 175 return cls(_target_point(rally.point))
Where a structure sends what it makes.
The unit rallied to, or the point: a spot on the ground, or where a unit now gone or out of sight stands or stood.
What an order or a rally point is aimed at: a position on the ground, or a unit.
75class Unit[K: UnitType.AnyType]: 76 """A unit of the game: one object under one id for the whole game, reading as the game last reported it. 77 78 Position, type and visibility read as of the last observation that listed the unit. Everything else reads as 79 of the last observation that showed it visible, `last_seen`, and raises `NotReportedError` for a unit never 80 shown visible. A structure out of sight stays in the observation as `IN_FOG`. A unit the observation 81 leaves out is unlisted, `is_listed` false: it keeps its last values, and is observed under the same id again if it 82 comes back. 83 84 `K` is the unit's `UnitType` for the type checker. A read only some types have is typed for them alone, as 85 `mineral_contents` is for a mineral field, and is an error on a unit typed as another type or as a group wider than 86 them. A unit typed `Unit[Any]` reads as any type. 87 """ 88 89 # `OwnUnit` declares no slots, so a unit can change between the two classes in place. `__weakref__` lets a bot 90 # refer to a unit weakly, which slots would otherwise rule out. A `WeakKeyDictionary` keyed by unit still keeps a 91 # dead unit's entry all game, as the tracker keeps every unit it has seen; a `UnitDict` forgets it. 92 __slots__ = ( 93 "__weakref__", 94 "_damage_taken", 95 "_dead", 96 "_first_seen", 97 "_hallucination_confirmed", 98 "_id", 99 "_latest_report", 100 "_last_seen", 101 "_latest_visible_report", 102 "_listed", 103 "_order_targets", 104 "_orders", 105 "_own", 106 "_position", 107 "_previous_position", 108 "_previous_report", 109 "_previous_step", 110 "_raw_alliance", 111 "_raw_type", 112 "_radius_footprint", 113 "_step", 114 "_tag", 115 "_tracker", 116 "_type_id", 117 ) 118 119 _tracker: _Tracker 120 _id: int 121 _tag: int 122 _latest_report: raw_pb2.Unit 123 _latest_visible_report: raw_pb2.Unit | None 124 _last_seen: int | None 125 # The step of the first observation that showed the unit visible, or `None` before one has. 126 _first_seen: int | None 127 # The alliance of the latest report, as the protocol numbers it, read once per report. 128 _raw_alliance: int 129 _raw_type: int 130 _type_id: UnitTypeId 131 _position: Point 132 _own: bool 133 _step: int 134 # Where the unit was at the last step before its latest, and that step, for `velocity`. Kept while the unit is out 135 # of the observation, and across a second observation at one step; let go as it comes back. 136 _previous_position: Point | None 137 _previous_step: int 138 # The report of the observation just before, for `damage_taken`, at every update. Let go as the unit leaves the 139 # observation, so it keeps that one observation alive and no other. 140 _previous_report: raw_pb2.Unit | None 141 # `damage_taken` as last worked out, with the tracker update it was worked out at. 142 _damage_taken: _Snapshot[float | None] 143 _listed: bool 144 _dead: bool 145 # Whether the enemy's unit was once reported a hallucination, which the game flags only while a detector is near 146 # (in game). 147 _hallucination_confirmed: bool 148 # The square its radius spans, kept once made, for a type of the map's own with no footprint measured. 149 _radius_footprint: Footprint | None 150 # For each ability, the unit this unit's latest order of that ability was aimed at, kept while the game names 151 # that unit by a tag it reports. Read when an order names a tag the game never reports. Keyed by the ability's raw 152 # id; `None` until an order is aimed at a unit. 153 _order_targets: dict[int, Unit[Any]] | None 154 # `OwnUnit.orders` as last read, with the tracker update it was read at, kept here since `OwnUnit` declares no 155 # slots of its own. It holds no report, so it keeps no observation alive. 156 _orders: _Snapshot[tuple[Order, ...]] 157 158 def __init__(self, report: raw_pb2.Unit, tracker: _Tracker, unit_id: int, step: int) -> None: 159 self._tracker = tracker 160 self._id = unit_id 161 self._tag = report.tag 162 self._latest_report = report 163 self._latest_visible_report = report if report.display_type == _VISIBLE else None 164 # Set only for a unit not visible; a visible unit was last seen at its last observation. 165 self._last_seen = None 166 self._first_seen = step if report.display_type == _VISIBLE else None 167 self._position = Point((report.pos.x, report.pos.y)) 168 self._raw_alliance = report.alliance 169 self._own = self._raw_alliance == _OWN_ALLIANCE 170 self._step = step 171 self._previous_position = None 172 self._previous_report = None 173 self._previous_step = step 174 self._damage_taken = _Snapshot(None) 175 self._listed = True 176 self._dead = False 177 self._hallucination_confirmed = not self._own and report.display_type == _VISIBLE and report.is_hallucination 178 self._radius_footprint = None 179 self._order_targets = None 180 self._orders = _Snapshot(()) 181 self._update_unit_type(report.unit_type) 182 183 def _update(self, report: raw_pb2.Unit, step: int) -> _SideOrTypeChange | None: 184 """Read this unit's report from the observation at `step`, under the tag it had before. Returns what the report 185 changed of its side and type, or `None` if it changed neither. 186 187 The tracker sets `_tag` itself when the unit is observed under a new one. 188 """ 189 position = self._position 190 last_step = self._step 191 if not self._listed: 192 # Back in the observation. How it moved while away is not known. 193 self._listed = True 194 self._previous_position = None 195 else: 196 # A unit is updated once an observation, so this is the report of the observation before. 197 self._previous_report = self._latest_report 198 if step != last_step: 199 self._previous_position = position 200 self._previous_step = last_step 201 self._step = step 202 reported = report.pos 203 x, y = reported.x, reported.y 204 # Most units stand still, and comparing is faster than building a new point. 205 if x != position[0] or y != position[1]: 206 self._position = Point((x, y)) 207 if report.display_type == _VISIBLE: 208 if self._first_seen is None: 209 self._first_seen = step 210 self._latest_visible_report = report 211 if not self._own and not self._hallucination_confirmed: 212 self._hallucination_confirmed = report.is_hallucination 213 elif self._latest_visible_report is self._latest_report: 214 # Just stopped being visible: the last sighting must outlive the observation it came in. 215 self._latest_visible_report = _copy(self._latest_report) 216 self._last_seen = last_step 217 previous_alliance = None if report.alliance == self._raw_alliance else self._update_alliance(report.alliance) 218 # The game reports orders for this player's units alone. 219 if self._own and (orders := self._latest_report.orders): 220 self._remember_order_targets(orders) 221 self._latest_report = report 222 if report.unit_type == self._raw_type: 223 return None if previous_alliance is None else _SideOrTypeChange(previous_alliance, None) 224 return _SideOrTypeChange(previous_alliance, self._morph_into(report.unit_type)) 225 226 def _remember_order_targets(self, orders: Iterable[raw_pb2.UnitOrder]) -> None: 227 """Keep, by ability, the unit each of `orders`, the latest report's, names under a tag the game has reported.""" 228 targets = self._order_targets 229 for order in orders: 230 tag = order.target_unit_tag 231 if not tag: 232 continue 233 # Most orders name the unit the last one did, under the tag it still has. 234 if targets is not None and (known := targets.get(order.ability_id)) is not None and known._tag == tag: 235 continue 236 if (unit := self._tracker.unit_tracker.get_by_tag(tag)) is not None: 237 if targets is None: 238 targets = self._order_targets = {} 239 targets[order.ability_id] = unit 240 241 def _mark_unlisted(self) -> None: 242 """Mark the unit unlisted: out of the observation, keeping its last values without keeping that observation 243 alive.""" 244 self._listed = False 245 self._previous_report = None 246 report = self._latest_report 247 copy = _copy(report) 248 if self._latest_visible_report is report: 249 self._latest_visible_report = copy 250 self._latest_report = copy 251 252 def _mark_dead(self) -> None: 253 """Mark the unit dead: out of the observation for good.""" 254 if self._listed: 255 self._mark_unlisted() 256 self._dead = True 257 258 def _update_unit_type(self, raw_type: int) -> None: 259 """Set the unit's type to `raw_type`. This is the one place a type is set, on creation and at every morph. 260 261 Raises `UncuratedIdError`, as the observation is taken in, for a type the curated ids leave out: a type the 262 game reports belongs among them. 263 """ 264 self._raw_type = raw_type 265 self._type_id = UnitTypeId.read(raw_type) 266 267 def _morph_into(self, raw_type: int) -> UnitTypeId: 268 """Set the unit's type to `raw_type`, a report's other than the last. Returns the type before.""" 269 previous_type = self._type_id 270 self._update_unit_type(raw_type) 271 return previous_type 272 273 def _update_alliance(self, raw_alliance: int) -> Alliance | None: 274 """Set the unit's alliance to `raw_alliance`, a report's other than the last, as the protocol numbers it. 275 Returns the alliance before if the unit changed sides, to or from this player's, or `None` if it did not. 276 277 A unit that changes sides changes class with them, to `OwnUnit` or back, as when a neural parasite takes it 278 over or lets it go. 279 """ 280 previous_alliance = None 281 if (raw_alliance == _OWN_ALLIANCE) is not self._own: 282 from sc2nachos.units._own_unit import OwnUnit 283 284 previous_alliance = _ALLIANCES[self._raw_alliance] 285 self._own = not self._own 286 # Assigning `self.__class__` directly type-checks only for a class of `Self`. 287 object.__setattr__(self, "__class__", OwnUnit if self._own else Unit) 288 self._raw_alliance = raw_alliance 289 return previous_alliance 290 291 def _never_seen_error(self, what: str) -> NotReportedError: 292 """The error for reading `what` from a unit the game has never shown visible.""" 293 return NotReportedError(f"the game never showed {self!r} visible, so it never reported its {what}") 294 295 def __repr__(self) -> str: 296 state = ", dead" if self._dead else "" if self._listed else ", unlisted" 297 return f"{type(self).__name__}({self._type_id.name}, id={self._id}, at {self._position}{state})" 298 299 # Identity. 300 301 @property 302 def id(self) -> int: 303 """NachOS's id for this unit, the same for the whole game. 304 305 The first digit is the unit's alliance when first seen, `Alliance.OWN` being 1 and `Alliance.ENEMY` 4. The 306 rest counts that alliance's units in the order they were first seen; in a replay played back with the fog off, 307 in the order the game first listed them, so that the unit is under the same id in `Api.all_units`. 308 """ 309 return self._id 310 311 @property 312 def first_alliance(self) -> Alliance: 313 """Whose side the unit was on when first seen, as its `id` records. A unit of this player's under a neural 314 parasite reads `Alliance.ENEMY` for `alliance` and `Alliance.OWN` here, and still takes this player's 315 supply.""" 316 return _ALLIANCES[self._id // _IDS_PER_ALLIANCE] 317 318 @property 319 def tag(self) -> int: 320 """The game's current tag for this unit. A structure's tag changes each time it goes out of sight.""" 321 return self._tag 322 323 @property 324 def type_id(self) -> UnitTypeId: 325 """The unit's type.""" 326 return self._type_id 327 328 @property 329 def alliance(self) -> Alliance: 330 """Whose side the unit is on.""" 331 return _ALLIANCES[self._raw_alliance] 332 333 @property 334 def is_own(self) -> bool: 335 """Whether the unit is this player's.""" 336 return self._raw_alliance == _OWN_ALLIANCE 337 338 @property 339 def is_enemy(self) -> bool: 340 """Whether the unit is the enemy's.""" 341 return self._raw_alliance == _ENEMY_ALLIANCE 342 343 @property 344 def owner_id(self) -> int: 345 """The id of the player the unit belongs to. 16 for the map's own units.""" 346 if (report := self._latest_visible_report) is None: 347 raise self._never_seen_error("owner") 348 return report.owner 349 350 # Whether the game still reports it. 351 352 @property 353 def is_listed(self) -> bool: 354 """Whether the last observation listed the unit: in sight and seen, in sight but cloaked and undetected, or a 355 structure remembered in the fog. Not once it went out of sight, or burrowed undetected, as a zergling does, or 356 went into a transport, a gas building or a structure it is becoming, as a drone does, nor once it died. 357 `is_visible` is the first of these alone.""" 358 return self._listed 359 360 @property 361 def is_dead(self) -> bool: 362 """Whether the unit is dead: reported dead, or a structure that cannot lift off or uproot gone from its spot. 363 364 The game reports only the deaths a player can see. A structure that dies out of sight is found dead when its 365 spot comes back into sight without it. A unit of this player's that became a structure, as a drone does, is 366 dead once that structure finishes, or once it dies without the unit coming back from a cancel. A dead unit is 367 never listed again. 368 """ 369 return self._dead 370 371 @property 372 def is_alive(self) -> bool: 373 """Whether the unit is not known to be dead: the opposite of `is_dead`. True for an enemy's unit that died out 374 of sight, whose death the game never reports, until NachOS finds it dead, as `is_dead` says for a structure.""" 375 return not self._dead 376 377 @property 378 def is_orderable(self) -> bool: 379 """Whether this player can order the unit now: the last observation listed it as this player's. Not while it 380 is inside a gas building or a transport, nor under a neural parasite, which makes it an enemy `Unit`, nor once 381 it is dead. Read it before ordering a unit kept from an earlier observation, or reading what only `OwnUnit` 382 has. It goes by the listing alone, so a reaper's grenade and a parasitic bomb left behind, each listed as its 383 caster's, read orderable.""" 384 return self._listed and self._own 385 386 @property 387 def first_seen(self) -> GameTime | None: 388 """The time of the first observation that showed the unit visible, or `None` if none has, as for `last_seen`. 389 A structure remembered under a new tag keeps it, as it keeps its `id`. Later than `EnemyUnitFirstSeenEvent` for 390 an enemy's unit first listed in the fog or undetected, which that event counts as first seen.""" 391 return None if self._first_seen is None else GameTime(steps=self._first_seen) 392 393 @property 394 def last_seen(self) -> GameTime | None: 395 """The time of the last observation that showed the unit visible, or `None` if none has.""" 396 if self._latest_report.display_type == _VISIBLE: 397 return GameTime(steps=self._step) 398 return None if self._last_seen is None else GameTime(steps=self._last_seen) 399 400 # Where it is. 401 402 @property 403 def position(self) -> Point: 404 """The unit's position on the ground plane.""" 405 return self._position 406 407 @property 408 def height(self) -> float: 409 """The unit's height, on the scale of the map's terrain heights.""" 410 return self._latest_report.pos.z 411 412 @property 413 def radius(self) -> float: 414 """The radius of the circle the unit takes up around its position.""" 415 return self._latest_report.radius 416 417 @property 418 def facing(self) -> float: 419 """The direction the unit faces, in radians from the positive x-axis.""" 420 if (report := self._latest_visible_report) is None: 421 raise self._never_seen_error("facing") 422 return report.facing 423 424 @property 425 def velocity(self) -> Point | None: 426 """The unit's velocity between its last two observations, in distance per second. 427 428 `None` for a unit observed only once since it was first seen or since it came back. 429 """ 430 previous = self._previous_position 431 if previous is None: 432 return None 433 position = self._position 434 scale = STEPS_PER_SECOND / (self._step - self._previous_step) 435 return Point(((position[0] - previous[0]) * scale, (position[1] - previous[1]) * scale)) 436 437 @property 438 def damage_taken(self) -> float | None: 439 """The health and shields the unit lost since the observation before, as `OwnUnitDamagedEvent` and 440 `EnemyUnitDamagedEvent` report it, and a neutral unit's alike, which no event reports; `None` unless it was 441 visible in both and kept its type. Health regained offsets only health lost, and shields regained only shields 442 lost. The health a stim costs is lost like any other.""" 443 update = self._tracker.last_changes.update 444 if (cached := self._damage_taken).update == update: 445 return cached.value 446 damage = self._damage_since_previous_report() 447 self._damage_taken = _Snapshot(damage, update) 448 return damage 449 450 def _damage_since_previous_report(self) -> float | None: 451 """The health and shields lost between the report of the observation before and the latest, as 452 `damage_taken` defines it.""" 453 previous = self._previous_report 454 if previous is None: 455 return None 456 report = self._latest_report 457 if ( 458 report.display_type != _VISIBLE 459 or previous.display_type != _VISIBLE 460 or report.unit_type != previous.unit_type 461 ): 462 return None 463 return max(0.0, previous.health - report.health) + max(0.0, previous.shield - report.shield) 464 465 # How it is seen. 466 467 @property 468 def visibility(self) -> Visibility: 469 """Whether the unit is visible, a structure remembered out of sight, or in sight but undetected.""" 470 return _VISIBILITIES[self._latest_report.display_type] 471 472 @property 473 def is_visible(self) -> bool: 474 """Whether the last observation showed the unit visible: in it, and seen, not cloaked or detected. False for an 475 unlisted unit, whose `visibility` reads as it was last listed.""" 476 return self._listed and self._latest_report.display_type == _VISIBLE 477 478 @property 479 def cloak_state(self) -> CloakState: 480 """Whether the unit is cloaked, and whether this player sees through it.""" 481 return _CLOAKS[self._latest_report.cloak] 482 483 @property 484 def is_selected(self) -> bool: 485 """Whether a human has the unit selected in the game window.""" 486 return self._latest_report.is_selected 487 488 @property 489 def is_flying(self) -> bool: 490 """Whether the unit is in the air, including one held up by a phoenix's graviton beam.""" 491 now = self._latest_report 492 if now.display_type != _IN_FOG: 493 return now.is_flying or _LIFTED in now.buff_ids 494 if (report := self._latest_visible_report) is None: 495 raise self._never_seen_error("flying") 496 return report.is_flying 497 498 @property 499 def is_burrowed(self) -> bool: 500 """Whether the unit is burrowed.""" 501 now = self._latest_report 502 if now.display_type != _IN_FOG: 503 return now.is_burrowed 504 if (report := self._latest_visible_report) is None: 505 raise self._never_seen_error("burrowing") 506 return report.is_burrowed 507 508 @property 509 def is_hallucination(self) -> bool: 510 """Whether the unit is a hallucination. Always known for this player's own units; an enemy's reads true once a 511 detector has shown it to be one, and stays true.""" 512 if self._hallucination_confirmed: 513 return True 514 if (report := self._latest_visible_report) is None: 515 raise self._never_seen_error("hallucination") 516 return report.is_hallucination 517 518 @property 519 def detect_range(self) -> float: 520 """How far the unit detects cloaked and burrowed units. 0 for a unit that does not detect.""" 521 if (report := self._latest_visible_report) is None: 522 raise self._never_seen_error("detection range") 523 return report.detect_range 524 525 @property 526 def radar_range(self) -> float: 527 """How far the unit's radar shows units. 0 for a unit without one.""" 528 if (report := self._latest_visible_report) is None: 529 raise self._never_seen_error("radar range") 530 return report.radar_range 531 532 # Vitals. 533 534 @property 535 def health(self) -> float: 536 """The unit's current health.""" 537 if (report := self._latest_visible_report) is None: 538 raise self._never_seen_error("health") 539 return report.health 540 541 @property 542 def health_max(self) -> float: 543 """The unit's maximum health.""" 544 if (report := self._latest_visible_report) is None: 545 raise self._never_seen_error("health") 546 return report.health_max 547 548 @property 549 def health_fraction(self) -> float: 550 """The unit's health as a fraction of its maximum.""" 551 if (report := self._latest_visible_report) is None: 552 raise self._never_seen_error("health") 553 return report.health / report.health_max if report.health_max else 0.0 554 555 @property 556 def shield(self) -> float: 557 """The unit's current shield.""" 558 if (report := self._latest_visible_report) is None: 559 raise self._never_seen_error("shield") 560 return report.shield 561 562 @property 563 def shield_max(self) -> float: 564 """The unit's maximum shield. 0 for a unit without one.""" 565 if (report := self._latest_visible_report) is None: 566 raise self._never_seen_error("shield") 567 return report.shield_max 568 569 @property 570 def shield_fraction(self) -> float: 571 """The unit's shield as a fraction of its maximum. 0 for a unit without one.""" 572 if (report := self._latest_visible_report) is None: 573 raise self._never_seen_error("shield") 574 return report.shield / report.shield_max if report.shield_max else 0.0 575 576 @property 577 def life(self) -> float: 578 """The unit's health and shield together.""" 579 if (report := self._latest_visible_report) is None: 580 raise self._never_seen_error("health") 581 return report.health + report.shield 582 583 @property 584 def life_max(self) -> float: 585 """The unit's maximum health and shield together.""" 586 if (report := self._latest_visible_report) is None: 587 raise self._never_seen_error("health") 588 return report.health_max + report.shield_max 589 590 @property 591 def life_fraction(self) -> float: 592 """The unit's health and shield together, as a fraction of their combined maximum.""" 593 if (report := self._latest_visible_report) is None: 594 raise self._never_seen_error("health") 595 most = report.health_max + report.shield_max 596 return (report.health + report.shield) / most if most else 0.0 597 598 @property 599 def energy(self) -> float: 600 """The unit's current energy.""" 601 if (report := self._latest_visible_report) is None: 602 raise self._never_seen_error("energy") 603 return report.energy 604 605 @property 606 def energy_max(self) -> float: 607 """The unit's maximum energy. 0 for a unit without energy.""" 608 if (report := self._latest_visible_report) is None: 609 raise self._never_seen_error("energy") 610 return report.energy_max 611 612 @property 613 def energy_fraction(self) -> float: 614 """The unit's energy as a fraction of its maximum. 0 for a unit without energy.""" 615 if (report := self._latest_visible_report) is None: 616 raise self._never_seen_error("energy") 617 return report.energy / report.energy_max if report.energy_max else 0.0 618 619 # State. 620 621 @property 622 def build_progress(self) -> float: 623 """A structure's progress through construction, or a unit's through warping in, from 0 to 1. 624 625 Anything else reads 1, anything morphing included. A larva's egg has its progress in its order; a cocoon and a 626 structure morphing report none (in game), and `morph_progress` works theirs out. 627 """ 628 if (report := self._latest_visible_report) is None: 629 raise self._never_seen_error("build progress") 630 return report.build_progress 631 632 @property 633 def is_complete(self) -> bool: 634 """Whether a structure has finished construction, or a unit has finished warping in. Anything else is 635 complete.""" 636 if (report := self._latest_visible_report) is None: 637 raise self._never_seen_error("build progress") 638 return report.build_progress == 1.0 639 640 @property 641 def morph_progress( 642 self: Unit[UnitType.CommandCenter | UnitType.Hatchery | UnitType.Lair | UnitType.Spire | UnitType.Cocoon], 643 ) -> Progress[UnitTypeId] | None: 644 """How far the unit's morph has got, of those the game reports no progress for: a command center becoming an 645 orbital command or a planetary fortress, a hatchery a lair, a lair a hive, a spire a greater spire, and a cocoon 646 or a lurker egg hatching. `None` for a unit not morphing, a dead one among them. 647 648 A morph is taken to begin at the step of the observation before the first that shows it, the step its order was 649 sent after (in game). `fraction` is the steps since then over the product's unrounded build time, and 650 `time_left` its `UnitTypeData.build_time` less those steps: exact for a structure of this player's, and to 651 within a step for a cocoon (in game), in a game the bot steps itself. In a realtime game, or on the ladder, a 652 morph can show an observation late, and an enemy's cocoon, or one of this player's queued behind another order, 653 may have begun at any step since the observation before. A structure takes its last step as the type it 654 becomes, unfinished (in game), and a morph past its time, such as an enemy's cocoon that hatched out of sight, 655 reads done. 656 657 Raises `NotReportedError` for an enemy's structure, whose morph the game does not show, and for a morph not seen 658 to begin: a cocoon first seen as one, back in sight or turned in the fog. 659 """ 660 return self._tracker.morph_tracker.progress_of(self) 661 662 @property 663 def is_powered(self: Unit[UnitType.ProtossStructure]) -> bool: 664 """Whether a Protoss structure stands in a pylon's power field. False for one that needs no power, such as a 665 nexus, a pylon or an assimilator.""" 666 if (report := self._latest_visible_report) is None: 667 raise self._never_seen_error("power") 668 return report.is_powered 669 670 @property 671 def is_active(self) -> bool: 672 """Whether the unit is busy: moving, attacking, gathering, training or researching. Reported for enemy units 673 too.""" 674 if (report := self._latest_visible_report) is None: 675 raise self._never_seen_error("activity") 676 return report.is_active 677 678 @property 679 def attack_upgrade_level(self) -> int: 680 """The unit's attack upgrade level.""" 681 if (report := self._latest_visible_report) is None: 682 raise self._never_seen_error("attack upgrades") 683 return report.attack_upgrade_level 684 685 @property 686 def armor_upgrade_level(self) -> int: 687 """The armor the unit's upgrades add. Not a count of levels: Chitinous Plating adds 2 to an ultralisk's.""" 688 if (report := self._latest_visible_report) is None: 689 raise self._never_seen_error("armor upgrades") 690 return report.armor_upgrade_level 691 692 @property 693 def shield_upgrade_level(self) -> int: 694 """The unit's shield upgrade level.""" 695 if (report := self._latest_visible_report) is None: 696 raise self._never_seen_error("shield upgrades") 697 return report.shield_upgrade_level 698 699 @property 700 def mineral_contents(self: Unit[UnitType.AnyMineralField]) -> int: 701 """The minerals left in a mineral field. 0 for anything else.""" 702 if (report := self._latest_visible_report) is None: 703 raise self._never_seen_error("minerals") 704 return report.mineral_contents 705 706 @property 707 def vespene_contents(self: Unit[UnitType.AnyVespeneGeyser | UnitType.GasBuilding]) -> int: 708 """The vespene left in a geyser, or in the gas building on it. 0 for anything else.""" 709 if (report := self._latest_visible_report) is None: 710 raise self._never_seen_error("vespene") 711 return report.vespene_contents 712 713 @property 714 def buffs(self) -> frozenset[BuffId]: 715 """The buffs on the unit, but those every unit of its type wears for as long as it is listed, which say nothing 716 its type does not: a parasitic bomb left behind reads none.""" 717 if (report := self._latest_visible_report) is None: 718 raise self._never_seen_error("buffs") 719 return frozenset(BuffId._read_each(report.buff_ids)) 720 721 def has_buff(self, buff_ids: BuffId | Collection[BuffId]) -> bool: 722 """Whether `buff_ids`, one buff or any of several, is among the unit's `buffs`. Raises `NotReportedError` for a 723 unit never shown visible, as `buffs` does.""" 724 unit_buffs = self.buffs 725 if isinstance(buff_ids, BuffId): 726 return buff_ids in unit_buffs 727 return not unit_buffs.isdisjoint(buff_ids) 728 729 @property 730 def is_carrying_resource(self) -> bool: 731 """Whether the unit carries minerals or gas, as its buffs show: false for a worker carrying gas from a rich 732 geyser, which the game gives no buff (in game). Raises `NotReportedError` for a unit never shown visible, as 733 `buffs` does.""" 734 return self.has_buff(_CARRYING_RESOURCE_BUFFS) 735 736 @property 737 def is_carrying_minerals(self) -> bool: 738 """Whether the unit carries minerals, from a plain field or a rich one, as its buffs show. Raises 739 `NotReportedError` for a unit never shown visible, as `buffs` does.""" 740 return self.has_buff(_CARRYING_MINERALS_BUFFS) 741 742 @property 743 def is_carrying_gas(self) -> bool: 744 """Whether the unit carries gas, as its buffs show: false for a worker carrying gas from a rich geyser, which 745 the game gives no buff (in game). Raises `NotReportedError` for a unit never shown visible, as `buffs` does.""" 746 return self.has_buff(BuffId.CARRYING_GAS) 747 748 # From the game's tables. 749 750 @property 751 def type_data(self) -> UnitTypeData: 752 """The game's table entry for the unit's type, before any upgrade.""" 753 return self._tracker.game_data.units[self.type_id] 754 755 @property 756 def weapons(self) -> tuple[Weapon, ...]: 757 """The unit type's weapons with its owner's upgrades applied: this player's upgrades for its own units, 758 `Api.enemy.upgrades` for the enemy's, and none for anyone else's. `active_weapons` are those it can fire now.""" 759 return self._tracker.upgrade_tracker.upgraded_type(self).weapons 760 761 @property 762 def speed(self) -> float: 763 """The unit type's speed with its owner's upgrades applied, as for `weapons`, before creep or any buff. In 764 distance per second, like `velocity`.""" 765 return self._tracker.upgrade_tracker.upgraded_type(self).speed 766 767 @property 768 def armor(self) -> float: 769 """The unit's base armor plus the armor its upgrades add: as the unit reports it when `is_visible`, and 770 otherwise the more of what it last reported visible and what its owner is known to have.""" 771 return self._tracker.upgrade_tracker.armor_of(self) 772 773 @property 774 def shield_armor(self) -> float: 775 """The armor of the unit's shields: its shield upgrade level as it reports it when `is_visible`, and otherwise 776 the more of what it last reported visible and the levels its owner is known to have; 0 for a unit without 777 shields. 778 779 The game's tables do not hold this. `docs/reference/game-behavior/damage-and-buffs.md` has what a level was 780 measured to take off a hit. 781 """ 782 return self._tracker.upgrade_tracker.shield_armor_of(self) 783 784 @property 785 def is_structure(self) -> bool: 786 """Whether the game's tables give the unit's type the structure attribute.""" 787 return Attribute.STRUCTURE in self.type_data.attributes 788 789 @property 790 def is_ground_structure(self) -> bool: 791 """Whether the unit is a structure standing on the ground: one not lifted, and one remembered out of sight, 792 whose flying the game does not report.""" 793 return self.is_structure and (self._latest_report.display_type == _IN_FOG or not self.is_flying) 794 795 def distance_to(self, other: PointLike | Unit[Any]) -> float: 796 """The distance from this unit's position to `other`, a point or another unit's position.""" 797 return self._position.distance_to(other._position if isinstance(other, Unit) else other) 798 799 @property 800 def footprint(self) -> Footprint | None: 801 """The tiles it covers where it stands: its type's footprint, or for a type of the map's own, of no race, that 802 does not move and has none measured, the square its radius spans. `None` for a unit that covers none, a force 803 field and a critter among them.""" 804 row = self._tracker.game_data.units.get(self.type_id) 805 if row is None: 806 return None 807 if row.footprint is None and row.race is Race.NONE and not row.speed: 808 side = round(2 * self.radius) 809 if not side: 810 return None 811 if self._radius_footprint is None or self._radius_footprint.width != side: 812 self._radius_footprint = Footprint.square(side) 813 return self._radius_footprint 814 return row.footprint 815 816 @property 817 def required_repair_cost(self) -> Cost | None: 818 """What one SCV's repair of the unit from its health now to whole takes: the time and resources of 819 `total_repair_cost` for the share of its health missing, each rounded up to a whole one, steps for the time (in 820 game), and nothing for a unit whole. `None` wherever `total_repair_cost` is.""" 821 return self._repair_cost_of(self.health_max - self.health) 822 823 @property 824 def total_repair_cost(self) -> Cost | None: 825 """What one SCV's repair of a unit of this type from no health to whole takes: the time its type costs, but 826 for a MULE, an auto-turret, a widow mine and an add-on standing on its own, and a quarter of the resources its 827 type costs, each rounded up, with no supply (in game). `None` for a structure under construction, which an SCV 828 is refused, and for any type but a Terran mechanical one. `docs/reference/game-behavior/damage-and-buffs.md` 829 has what was measured.""" 830 return self._repair_cost_of(self.health_max) 831 832 @property 833 def is_repairable(self) -> bool: 834 """Whether `total_repair_cost` gives a cost: whether the unit is a complete Terran mechanical one, whoever's it 835 is, an enemy's included. Raises `NotReportedError` for a Terran mechanical unit never 836 shown visible, whose build progress the game never reported.""" 837 return self.total_repair_cost is not None 838 839 def time_to_face( 840 self, target: PointLike | Unit[Any], *, facing_tolerance: float = _DEFAULT_FACING_TOLERANCE 841 ) -> GameTime | None: 842 """The time the unit takes to turn to face `target`, a point or another unit: the angle to turn over its type's 843 `turn_rate`, rounded up to a whole step (in game); zero if it faces it already, to within `facing_tolerance` 844 radians, a degree unless given. Counted from the step its turn begins, which an order sets off a step after it 845 in a game stepped by the bot, and may set off later in a realtime one, as on the ladder. `None` wherever 846 `turn_rate` is: for a type whose facing the game never changes and for one that does not move. 847 `docs/reference/game-behavior/units.md` has what was measured.""" 848 if (turn_rate := self.type_data.turn_rate) is None: 849 return None 850 target_position = target._position if isinstance(target, Unit) else target 851 if self._position.distance_to(target_position) == 0: 852 return GameTime.ZERO 853 bearing = self._position.angle_to(target_position) 854 angle_to_turn = abs((bearing - self.facing + math.pi) % math.tau - math.pi) 855 if angle_to_turn <= facing_tolerance: 856 return GameTime.ZERO 857 return GameTime(steps=math.ceil(angle_to_turn / turn_rate)) 858 859 def _repair_cost_of(self, missing_health: float) -> Cost | None: 860 """What one SCV's repair of `missing_health` of the unit takes; `None` wherever `total_repair_cost` is.""" 861 type_data = self.type_data 862 is_terran_and_mechanical = type_data.race is Race.TERRAN and Attribute.MECHANICAL in type_data.attributes 863 if not is_terran_and_mechanical or not self.is_complete: 864 return None 865 # Priced from everything spent to reach the type, an orbital command's 550 (tool `sweep_repair`). 866 type_cost, health_max = type_data._whole_cost, self.health_max 867 whole_repair_steps = REPAIR_STEPS_EXCEPTIONS.get(self.type_id, type_cost.time.steps) 868 # Multiplied out before the one division, so that a whole number of resources comes out whole. 869 return Cost( 870 math.ceil(missing_health * type_cost.minerals * REPAIR_COST_FRACTION / health_max), 871 math.ceil(missing_health * type_cost.vespene * REPAIR_COST_FRACTION / health_max), 872 time=GameTime(steps=math.ceil(whole_repair_steps * missing_health / health_max)), 873 ) 874 875 # Combat. 876 877 @property 878 def active_weapons(self) -> tuple[Weapon, ...]: 879 """The weapons of `weapons` the unit can fire now: all of them, but none for an oracle whose beam is off, which 880 wears `BuffId.ORACLE_PULSAR_BEAM` exactly while it is on (in game). Raises `NotReportedError` for an oracle 881 never shown visible.""" 882 if self.type_id is UnitTypeId.ORACLE and BuffId.ORACLE_PULSAR_BEAM not in self.buffs: 883 return () 884 return self.weapons 885 886 @property 887 def ground_weapon(self) -> Weapon | None: 888 """The weapon of `active_weapons` that fires at the ground, alone or with the air, or `None`. No type has two 889 that do (corpus). Raises as `active_weapons` does.""" 890 return self._weapon_firing_at(TargetDomain.GROUND) 891 892 @property 893 def air_weapon(self) -> Weapon | None: 894 """The weapon of `active_weapons` that fires at the air, alone or with the ground, or `None`, as 895 `ground_weapon` is for the ground.""" 896 return self._weapon_firing_at(TargetDomain.AIR) 897 898 @property 899 def ground_range(self) -> float: 900 """The range of `ground_weapon`, with its owner's upgrades, or 0 without one.""" 901 weapon = self.ground_weapon 902 return 0.0 if weapon is None else weapon.range 903 904 @property 905 def air_range(self) -> float: 906 """The range of `air_weapon`, with its owner's upgrades, or 0 without one.""" 907 weapon = self.air_weapon 908 return 0.0 if weapon is None else weapon.range 909 910 @property 911 def ground_damage(self) -> float: 912 """What one attack of `ground_weapon` does before bonuses and armor, its `total_damage`, or 0 without 913 one. A hallucination's counts; `damage_against` is what an attack takes off a target.""" 914 weapon = self.ground_weapon 915 return 0.0 if weapon is None else weapon.total_damage 916 917 @property 918 def air_damage(self) -> float: 919 """What one attack of `air_weapon` does before bonuses and armor, as `ground_damage` is for the ground.""" 920 weapon = self.air_weapon 921 return 0.0 if weapon is None else weapon.total_damage 922 923 @property 924 def ground_dps(self) -> float: 925 """The `dps` of `ground_weapon`, per second of the game's Faster speed with the mean attack delay, before 926 bonuses, armor and buffs, or 0 without one. A hallucination's counts; `dps_against` is what a target takes.""" 927 weapon = self.ground_weapon 928 return 0.0 if weapon is None else weapon.dps 929 930 @property 931 def air_dps(self) -> float: 932 """The `dps` of `air_weapon`, as `ground_dps` is for the ground.""" 933 weapon = self.air_weapon 934 return 0.0 if weapon is None else weapon.dps 935 936 @property 937 def is_melee(self) -> bool: 938 """Whether the unit fires at the ground from no farther than 1: its `ground_range` above 0 and at most 1, as a 939 zealot's and a zergling's are.""" 940 return 0.0 < self.ground_range <= 1.0 941 942 def _weapon_firing_at(self, domain: TargetDomain) -> Weapon | None: 943 """The weapon of `active_weapons` that fires at `domain`, the ground or the air, alone or with the other.""" 944 return next( 945 (weapon for weapon in self.active_weapons if weapon.target_domain in (domain, TargetDomain.ANY)), None 946 ) 947 948 def weapon_against(self, target: Unit[Any]) -> Weapon | None: 949 """The weapon of `active_weapons` this unit fires at `target`: one that hits the air for a target that flies, 950 and one that hits the ground for a target on it, or failing that, for a colossus, one that hits the air, as a 951 viking's did (in game). `None` if it has none that hits `target`, an oracle whose beam is off among them. 952 953 Raises `NotReportedError` for a target remembered in the fog and never seen visible, as `is_flying` does, and 954 for an oracle never shown visible. 955 """ 956 weapons = self.active_weapons 957 if target.is_flying: 958 return next((weapon for weapon in weapons if weapon.target_domain is not TargetDomain.GROUND), None) 959 on_the_ground = next((weapon for weapon in weapons if weapon.target_domain is not TargetDomain.AIR), None) 960 if on_the_ground is None and target.type_id in _GROUND_TYPES_HIT_FROM_THE_AIR: 961 return next((weapon for weapon in weapons if weapon.target_domain is TargetDomain.AIR), None) 962 return on_the_ground 963 964 def has_in_range(self, target: Unit[Any], *, margin: float = 0.0) -> bool: 965 """Whether `target` is within the reach of `weapon_against(target)`: their centers no farther apart than its 966 range, both radii and `margin`. False if this unit has no weapon against `target`. 967 968 That is where a unit that can move fires at another unit (in game). An attacker that cannot move, such as a 969 sieged tank or a spine crawler, fires from up to some 0.1 nearer, and any attacker fires at a structure from up 970 to some 0.26 nearer, so pass a negative `margin` to be sure the shot can land. Raises as `weapon_against` does. 971 """ 972 weapon = self.weapon_against(target) 973 return weapon is not None and self.distance_to(target) <= weapon.range + self.radius + target.radius + margin 974 975 def damage_against(self, target: Unit[Any]) -> float: 976 """What one attack of `weapon_against(target)` takes off `target`'s shields and health as they stand, every hit 977 of it counted, as `Weapon.damage_against` works it out from the target's attributes, `armor`, `shield_armor` 978 and `shield`. 0 if 979 this unit has no weapon against it or is a hallucination, which does no damage (stated). An enemy's reads as 980 one only once revealed, as `is_hallucination` has it. No buff on either unit counts. 981 982 Raises `NotReportedError` as `weapon_against` does, and for a unit of the two never shown visible, whose 983 shields or hallucination the game never reported. 984 """ 985 weapon = self.weapon_against(target) 986 return 0.0 if weapon is None or self.is_hallucination else _damage_of_one_attack(weapon, target) 987 988 def bonus_damage_against(self, target: Unit[Any]) -> float: 989 """The bonus damage one attack of `weapon_against(target)` does for `target`'s attributes, before armor: its 990 `Weapon.bonus_per_hit_against` them, times its attacks. 0 if this unit has no weapon against it. A 991 hallucination's counts, as for `ground_damage`. Raises `NotReportedError` as `weapon_against` does.""" 992 weapon = self.weapon_against(target) 993 if weapon is None: 994 return 0.0 995 return weapon.bonus_per_hit_against(target.type_data.attributes) * weapon.attacks 996 997 def dps_against(self, target: Unit[Any]) -> float: 998 """`damage_against(target)` per second of real time at the game's Faster speed, with `weapon_against(target)` 999 attacking as often as the buffs on this unit have it: stim makes a marine's and a marauder's 1.5 times as often 1000 (in game). 0 where `damage_against` is. 1001 1002 Raises `NotReportedError` as `damage_against` does. 1003 """ 1004 weapon = self.weapon_against(target) 1005 if weapon is None or self.is_hallucination: 1006 return 0.0 1007 damage = _damage_of_one_attack(weapon, target) 1008 if (report := self._latest_visible_report) is None: 1009 raise self._never_seen_error("buffs") 1010 # What speeds an attack divides the base cooldown, and leaves the random delay as it is (in game). 1011 attack_speed_multiplier = math.prod(_ATTACK_SPEED_BY_RAW_BUFF.get(buff, 1.0) for buff in report.buff_ids) 1012 # In plain steps, which spares two `GameTime`s a call in a targeting loop. 1013 cooldown_steps = weapon.base_cooldown.steps / attack_speed_multiplier + weapon.mean_delay.steps 1014 return damage * STEPS_PER_SECOND / cooldown_steps
A unit of the game: one object under one id for the whole game, reading as the game last reported it.
Position, type and visibility read as of the last observation that listed the unit. Everything else reads as
of the last observation that showed it visible, last_seen, and raises NotReportedError for a unit never
shown visible. A structure out of sight stays in the observation as IN_FOG. A unit the observation
leaves out is unlisted, is_listed false: it keeps its last values, and is observed under the same id again if it
comes back.
K is the unit's UnitType for the type checker. A read only some types have is typed for them alone, as
mineral_contents is for a mineral field, and is an error on a unit typed as another type or as a group wider than
them. A unit typed Unit[Any] reads as any type.
158 def __init__(self, report: raw_pb2.Unit, tracker: _Tracker, unit_id: int, step: int) -> None: 159 self._tracker = tracker 160 self._id = unit_id 161 self._tag = report.tag 162 self._latest_report = report 163 self._latest_visible_report = report if report.display_type == _VISIBLE else None 164 # Set only for a unit not visible; a visible unit was last seen at its last observation. 165 self._last_seen = None 166 self._first_seen = step if report.display_type == _VISIBLE else None 167 self._position = Point((report.pos.x, report.pos.y)) 168 self._raw_alliance = report.alliance 169 self._own = self._raw_alliance == _OWN_ALLIANCE 170 self._step = step 171 self._previous_position = None 172 self._previous_report = None 173 self._previous_step = step 174 self._damage_taken = _Snapshot(None) 175 self._listed = True 176 self._dead = False 177 self._hallucination_confirmed = not self._own and report.display_type == _VISIBLE and report.is_hallucination 178 self._radius_footprint = None 179 self._order_targets = None 180 self._orders = _Snapshot(()) 181 self._update_unit_type(report.unit_type)
301 @property 302 def id(self) -> int: 303 """NachOS's id for this unit, the same for the whole game. 304 305 The first digit is the unit's alliance when first seen, `Alliance.OWN` being 1 and `Alliance.ENEMY` 4. The 306 rest counts that alliance's units in the order they were first seen; in a replay played back with the fog off, 307 in the order the game first listed them, so that the unit is under the same id in `Api.all_units`. 308 """ 309 return self._id
NachOS's id for this unit, the same for the whole game.
The first digit is the unit's alliance when first seen, Alliance.OWN being 1 and Alliance.ENEMY 4. The
rest counts that alliance's units in the order they were first seen; in a replay played back with the fog off,
in the order the game first listed them, so that the unit is under the same id in Api.all_units.
311 @property 312 def first_alliance(self) -> Alliance: 313 """Whose side the unit was on when first seen, as its `id` records. A unit of this player's under a neural 314 parasite reads `Alliance.ENEMY` for `alliance` and `Alliance.OWN` here, and still takes this player's 315 supply.""" 316 return _ALLIANCES[self._id // _IDS_PER_ALLIANCE]
Whose side the unit was on when first seen, as its id records. A unit of this player's under a neural
parasite reads Alliance.ENEMY for alliance and Alliance.OWN here, and still takes this player's
supply.
318 @property 319 def tag(self) -> int: 320 """The game's current tag for this unit. A structure's tag changes each time it goes out of sight.""" 321 return self._tag
The game's current tag for this unit. A structure's tag changes each time it goes out of sight.
323 @property 324 def type_id(self) -> UnitTypeId: 325 """The unit's type.""" 326 return self._type_id
The unit's type.
328 @property 329 def alliance(self) -> Alliance: 330 """Whose side the unit is on.""" 331 return _ALLIANCES[self._raw_alliance]
Whose side the unit is on.
333 @property 334 def is_own(self) -> bool: 335 """Whether the unit is this player's.""" 336 return self._raw_alliance == _OWN_ALLIANCE
Whether the unit is this player's.
338 @property 339 def is_enemy(self) -> bool: 340 """Whether the unit is the enemy's.""" 341 return self._raw_alliance == _ENEMY_ALLIANCE
Whether the unit is the enemy's.
343 @property 344 def owner_id(self) -> int: 345 """The id of the player the unit belongs to. 16 for the map's own units.""" 346 if (report := self._latest_visible_report) is None: 347 raise self._never_seen_error("owner") 348 return report.owner
The id of the player the unit belongs to. 16 for the map's own units.
352 @property 353 def is_listed(self) -> bool: 354 """Whether the last observation listed the unit: in sight and seen, in sight but cloaked and undetected, or a 355 structure remembered in the fog. Not once it went out of sight, or burrowed undetected, as a zergling does, or 356 went into a transport, a gas building or a structure it is becoming, as a drone does, nor once it died. 357 `is_visible` is the first of these alone.""" 358 return self._listed
Whether the last observation listed the unit: in sight and seen, in sight but cloaked and undetected, or a
structure remembered in the fog. Not once it went out of sight, or burrowed undetected, as a zergling does, or
went into a transport, a gas building or a structure it is becoming, as a drone does, nor once it died.
is_visible is the first of these alone.
360 @property 361 def is_dead(self) -> bool: 362 """Whether the unit is dead: reported dead, or a structure that cannot lift off or uproot gone from its spot. 363 364 The game reports only the deaths a player can see. A structure that dies out of sight is found dead when its 365 spot comes back into sight without it. A unit of this player's that became a structure, as a drone does, is 366 dead once that structure finishes, or once it dies without the unit coming back from a cancel. A dead unit is 367 never listed again. 368 """ 369 return self._dead
Whether the unit is dead: reported dead, or a structure that cannot lift off or uproot gone from its spot.
The game reports only the deaths a player can see. A structure that dies out of sight is found dead when its spot comes back into sight without it. A unit of this player's that became a structure, as a drone does, is dead once that structure finishes, or once it dies without the unit coming back from a cancel. A dead unit is never listed again.
371 @property 372 def is_alive(self) -> bool: 373 """Whether the unit is not known to be dead: the opposite of `is_dead`. True for an enemy's unit that died out 374 of sight, whose death the game never reports, until NachOS finds it dead, as `is_dead` says for a structure.""" 375 return not self._dead
377 @property 378 def is_orderable(self) -> bool: 379 """Whether this player can order the unit now: the last observation listed it as this player's. Not while it 380 is inside a gas building or a transport, nor under a neural parasite, which makes it an enemy `Unit`, nor once 381 it is dead. Read it before ordering a unit kept from an earlier observation, or reading what only `OwnUnit` 382 has. It goes by the listing alone, so a reaper's grenade and a parasitic bomb left behind, each listed as its 383 caster's, read orderable.""" 384 return self._listed and self._own
Whether this player can order the unit now: the last observation listed it as this player's. Not while it
is inside a gas building or a transport, nor under a neural parasite, which makes it an enemy Unit, nor once
it is dead. Read it before ordering a unit kept from an earlier observation, or reading what only OwnUnit
has. It goes by the listing alone, so a reaper's grenade and a parasitic bomb left behind, each listed as its
caster's, read orderable.
386 @property 387 def first_seen(self) -> GameTime | None: 388 """The time of the first observation that showed the unit visible, or `None` if none has, as for `last_seen`. 389 A structure remembered under a new tag keeps it, as it keeps its `id`. Later than `EnemyUnitFirstSeenEvent` for 390 an enemy's unit first listed in the fog or undetected, which that event counts as first seen.""" 391 return None if self._first_seen is None else GameTime(steps=self._first_seen)
The time of the first observation that showed the unit visible, or None if none has, as for last_seen.
A structure remembered under a new tag keeps it, as it keeps its id. Later than EnemyUnitFirstSeenEvent for
an enemy's unit first listed in the fog or undetected, which that event counts as first seen.
393 @property 394 def last_seen(self) -> GameTime | None: 395 """The time of the last observation that showed the unit visible, or `None` if none has.""" 396 if self._latest_report.display_type == _VISIBLE: 397 return GameTime(steps=self._step) 398 return None if self._last_seen is None else GameTime(steps=self._last_seen)
The time of the last observation that showed the unit visible, or None if none has.
402 @property 403 def position(self) -> Point: 404 """The unit's position on the ground plane.""" 405 return self._position
The unit's position on the ground plane.
407 @property 408 def height(self) -> float: 409 """The unit's height, on the scale of the map's terrain heights.""" 410 return self._latest_report.pos.z
The unit's height, on the scale of the map's terrain heights.
412 @property 413 def radius(self) -> float: 414 """The radius of the circle the unit takes up around its position.""" 415 return self._latest_report.radius
The radius of the circle the unit takes up around its position.
417 @property 418 def facing(self) -> float: 419 """The direction the unit faces, in radians from the positive x-axis.""" 420 if (report := self._latest_visible_report) is None: 421 raise self._never_seen_error("facing") 422 return report.facing
The direction the unit faces, in radians from the positive x-axis.
424 @property 425 def velocity(self) -> Point | None: 426 """The unit's velocity between its last two observations, in distance per second. 427 428 `None` for a unit observed only once since it was first seen or since it came back. 429 """ 430 previous = self._previous_position 431 if previous is None: 432 return None 433 position = self._position 434 scale = STEPS_PER_SECOND / (self._step - self._previous_step) 435 return Point(((position[0] - previous[0]) * scale, (position[1] - previous[1]) * scale))
The unit's velocity between its last two observations, in distance per second.
None for a unit observed only once since it was first seen or since it came back.
437 @property 438 def damage_taken(self) -> float | None: 439 """The health and shields the unit lost since the observation before, as `OwnUnitDamagedEvent` and 440 `EnemyUnitDamagedEvent` report it, and a neutral unit's alike, which no event reports; `None` unless it was 441 visible in both and kept its type. Health regained offsets only health lost, and shields regained only shields 442 lost. The health a stim costs is lost like any other.""" 443 update = self._tracker.last_changes.update 444 if (cached := self._damage_taken).update == update: 445 return cached.value 446 damage = self._damage_since_previous_report() 447 self._damage_taken = _Snapshot(damage, update) 448 return damage
The health and shields the unit lost since the observation before, as OwnUnitDamagedEvent and
EnemyUnitDamagedEvent report it, and a neutral unit's alike, which no event reports; None unless it was
visible in both and kept its type. Health regained offsets only health lost, and shields regained only shields
lost. The health a stim costs is lost like any other.
467 @property 468 def visibility(self) -> Visibility: 469 """Whether the unit is visible, a structure remembered out of sight, or in sight but undetected.""" 470 return _VISIBILITIES[self._latest_report.display_type]
Whether the unit is visible, a structure remembered out of sight, or in sight but undetected.
472 @property 473 def is_visible(self) -> bool: 474 """Whether the last observation showed the unit visible: in it, and seen, not cloaked or detected. False for an 475 unlisted unit, whose `visibility` reads as it was last listed.""" 476 return self._listed and self._latest_report.display_type == _VISIBLE
Whether the last observation showed the unit visible: in it, and seen, not cloaked or detected. False for an
unlisted unit, whose visibility reads as it was last listed.
478 @property 479 def cloak_state(self) -> CloakState: 480 """Whether the unit is cloaked, and whether this player sees through it.""" 481 return _CLOAKS[self._latest_report.cloak]
Whether the unit is cloaked, and whether this player sees through it.
483 @property 484 def is_selected(self) -> bool: 485 """Whether a human has the unit selected in the game window.""" 486 return self._latest_report.is_selected
Whether a human has the unit selected in the game window.
488 @property 489 def is_flying(self) -> bool: 490 """Whether the unit is in the air, including one held up by a phoenix's graviton beam.""" 491 now = self._latest_report 492 if now.display_type != _IN_FOG: 493 return now.is_flying or _LIFTED in now.buff_ids 494 if (report := self._latest_visible_report) is None: 495 raise self._never_seen_error("flying") 496 return report.is_flying
Whether the unit is in the air, including one held up by a phoenix's graviton beam.
498 @property 499 def is_burrowed(self) -> bool: 500 """Whether the unit is burrowed.""" 501 now = self._latest_report 502 if now.display_type != _IN_FOG: 503 return now.is_burrowed 504 if (report := self._latest_visible_report) is None: 505 raise self._never_seen_error("burrowing") 506 return report.is_burrowed
Whether the unit is burrowed.
508 @property 509 def is_hallucination(self) -> bool: 510 """Whether the unit is a hallucination. Always known for this player's own units; an enemy's reads true once a 511 detector has shown it to be one, and stays true.""" 512 if self._hallucination_confirmed: 513 return True 514 if (report := self._latest_visible_report) is None: 515 raise self._never_seen_error("hallucination") 516 return report.is_hallucination
Whether the unit is a hallucination. Always known for this player's own units; an enemy's reads true once a detector has shown it to be one, and stays true.
518 @property 519 def detect_range(self) -> float: 520 """How far the unit detects cloaked and burrowed units. 0 for a unit that does not detect.""" 521 if (report := self._latest_visible_report) is None: 522 raise self._never_seen_error("detection range") 523 return report.detect_range
How far the unit detects cloaked and burrowed units. 0 for a unit that does not detect.
525 @property 526 def radar_range(self) -> float: 527 """How far the unit's radar shows units. 0 for a unit without one.""" 528 if (report := self._latest_visible_report) is None: 529 raise self._never_seen_error("radar range") 530 return report.radar_range
How far the unit's radar shows units. 0 for a unit without one.
534 @property 535 def health(self) -> float: 536 """The unit's current health.""" 537 if (report := self._latest_visible_report) is None: 538 raise self._never_seen_error("health") 539 return report.health
The unit's current health.
541 @property 542 def health_max(self) -> float: 543 """The unit's maximum health.""" 544 if (report := self._latest_visible_report) is None: 545 raise self._never_seen_error("health") 546 return report.health_max
The unit's maximum health.
548 @property 549 def health_fraction(self) -> float: 550 """The unit's health as a fraction of its maximum.""" 551 if (report := self._latest_visible_report) is None: 552 raise self._never_seen_error("health") 553 return report.health / report.health_max if report.health_max else 0.0
The unit's health as a fraction of its maximum.
555 @property 556 def shield(self) -> float: 557 """The unit's current shield.""" 558 if (report := self._latest_visible_report) is None: 559 raise self._never_seen_error("shield") 560 return report.shield
The unit's current shield.
562 @property 563 def shield_max(self) -> float: 564 """The unit's maximum shield. 0 for a unit without one.""" 565 if (report := self._latest_visible_report) is None: 566 raise self._never_seen_error("shield") 567 return report.shield_max
The unit's maximum shield. 0 for a unit without one.
569 @property 570 def shield_fraction(self) -> float: 571 """The unit's shield as a fraction of its maximum. 0 for a unit without one.""" 572 if (report := self._latest_visible_report) is None: 573 raise self._never_seen_error("shield") 574 return report.shield / report.shield_max if report.shield_max else 0.0
The unit's shield as a fraction of its maximum. 0 for a unit without one.
576 @property 577 def life(self) -> float: 578 """The unit's health and shield together.""" 579 if (report := self._latest_visible_report) is None: 580 raise self._never_seen_error("health") 581 return report.health + report.shield
The unit's health and shield together.
583 @property 584 def life_max(self) -> float: 585 """The unit's maximum health and shield together.""" 586 if (report := self._latest_visible_report) is None: 587 raise self._never_seen_error("health") 588 return report.health_max + report.shield_max
The unit's maximum health and shield together.
590 @property 591 def life_fraction(self) -> float: 592 """The unit's health and shield together, as a fraction of their combined maximum.""" 593 if (report := self._latest_visible_report) is None: 594 raise self._never_seen_error("health") 595 most = report.health_max + report.shield_max 596 return (report.health + report.shield) / most if most else 0.0
The unit's health and shield together, as a fraction of their combined maximum.
598 @property 599 def energy(self) -> float: 600 """The unit's current energy.""" 601 if (report := self._latest_visible_report) is None: 602 raise self._never_seen_error("energy") 603 return report.energy
The unit's current energy.
605 @property 606 def energy_max(self) -> float: 607 """The unit's maximum energy. 0 for a unit without energy.""" 608 if (report := self._latest_visible_report) is None: 609 raise self._never_seen_error("energy") 610 return report.energy_max
The unit's maximum energy. 0 for a unit without energy.
612 @property 613 def energy_fraction(self) -> float: 614 """The unit's energy as a fraction of its maximum. 0 for a unit without energy.""" 615 if (report := self._latest_visible_report) is None: 616 raise self._never_seen_error("energy") 617 return report.energy / report.energy_max if report.energy_max else 0.0
The unit's energy as a fraction of its maximum. 0 for a unit without energy.
621 @property 622 def build_progress(self) -> float: 623 """A structure's progress through construction, or a unit's through warping in, from 0 to 1. 624 625 Anything else reads 1, anything morphing included. A larva's egg has its progress in its order; a cocoon and a 626 structure morphing report none (in game), and `morph_progress` works theirs out. 627 """ 628 if (report := self._latest_visible_report) is None: 629 raise self._never_seen_error("build progress") 630 return report.build_progress
A structure's progress through construction, or a unit's through warping in, from 0 to 1.
Anything else reads 1, anything morphing included. A larva's egg has its progress in its order; a cocoon and a
structure morphing report none (in game), and morph_progress works theirs out.
632 @property 633 def is_complete(self) -> bool: 634 """Whether a structure has finished construction, or a unit has finished warping in. Anything else is 635 complete.""" 636 if (report := self._latest_visible_report) is None: 637 raise self._never_seen_error("build progress") 638 return report.build_progress == 1.0
Whether a structure has finished construction, or a unit has finished warping in. Anything else is complete.
640 @property 641 def morph_progress( 642 self: Unit[UnitType.CommandCenter | UnitType.Hatchery | UnitType.Lair | UnitType.Spire | UnitType.Cocoon], 643 ) -> Progress[UnitTypeId] | None: 644 """How far the unit's morph has got, of those the game reports no progress for: a command center becoming an 645 orbital command or a planetary fortress, a hatchery a lair, a lair a hive, a spire a greater spire, and a cocoon 646 or a lurker egg hatching. `None` for a unit not morphing, a dead one among them. 647 648 A morph is taken to begin at the step of the observation before the first that shows it, the step its order was 649 sent after (in game). `fraction` is the steps since then over the product's unrounded build time, and 650 `time_left` its `UnitTypeData.build_time` less those steps: exact for a structure of this player's, and to 651 within a step for a cocoon (in game), in a game the bot steps itself. In a realtime game, or on the ladder, a 652 morph can show an observation late, and an enemy's cocoon, or one of this player's queued behind another order, 653 may have begun at any step since the observation before. A structure takes its last step as the type it 654 becomes, unfinished (in game), and a morph past its time, such as an enemy's cocoon that hatched out of sight, 655 reads done. 656 657 Raises `NotReportedError` for an enemy's structure, whose morph the game does not show, and for a morph not seen 658 to begin: a cocoon first seen as one, back in sight or turned in the fog. 659 """ 660 return self._tracker.morph_tracker.progress_of(self)
How far the unit's morph has got, of those the game reports no progress for: a command center becoming an
orbital command or a planetary fortress, a hatchery a lair, a lair a hive, a spire a greater spire, and a cocoon
or a lurker egg hatching. None for a unit not morphing, a dead one among them.
A morph is taken to begin at the step of the observation before the first that shows it, the step its order was
sent after (in game). fraction is the steps since then over the product's unrounded build time, and
time_left its UnitTypeData.build_time less those steps: exact for a structure of this player's, and to
within a step for a cocoon (in game), in a game the bot steps itself. In a realtime game, or on the ladder, a
morph can show an observation late, and an enemy's cocoon, or one of this player's queued behind another order,
may have begun at any step since the observation before. A structure takes its last step as the type it
becomes, unfinished (in game), and a morph past its time, such as an enemy's cocoon that hatched out of sight,
reads done.
Raises NotReportedError for an enemy's structure, whose morph the game does not show, and for a morph not seen
to begin: a cocoon first seen as one, back in sight or turned in the fog.
662 @property 663 def is_powered(self: Unit[UnitType.ProtossStructure]) -> bool: 664 """Whether a Protoss structure stands in a pylon's power field. False for one that needs no power, such as a 665 nexus, a pylon or an assimilator.""" 666 if (report := self._latest_visible_report) is None: 667 raise self._never_seen_error("power") 668 return report.is_powered
Whether a Protoss structure stands in a pylon's power field. False for one that needs no power, such as a nexus, a pylon or an assimilator.
670 @property 671 def is_active(self) -> bool: 672 """Whether the unit is busy: moving, attacking, gathering, training or researching. Reported for enemy units 673 too.""" 674 if (report := self._latest_visible_report) is None: 675 raise self._never_seen_error("activity") 676 return report.is_active
Whether the unit is busy: moving, attacking, gathering, training or researching. Reported for enemy units too.
678 @property 679 def attack_upgrade_level(self) -> int: 680 """The unit's attack upgrade level.""" 681 if (report := self._latest_visible_report) is None: 682 raise self._never_seen_error("attack upgrades") 683 return report.attack_upgrade_level
The unit's attack upgrade level.
685 @property 686 def armor_upgrade_level(self) -> int: 687 """The armor the unit's upgrades add. Not a count of levels: Chitinous Plating adds 2 to an ultralisk's.""" 688 if (report := self._latest_visible_report) is None: 689 raise self._never_seen_error("armor upgrades") 690 return report.armor_upgrade_level
The armor the unit's upgrades add. Not a count of levels: Chitinous Plating adds 2 to an ultralisk's.
692 @property 693 def shield_upgrade_level(self) -> int: 694 """The unit's shield upgrade level.""" 695 if (report := self._latest_visible_report) is None: 696 raise self._never_seen_error("shield upgrades") 697 return report.shield_upgrade_level
The unit's shield upgrade level.
699 @property 700 def mineral_contents(self: Unit[UnitType.AnyMineralField]) -> int: 701 """The minerals left in a mineral field. 0 for anything else.""" 702 if (report := self._latest_visible_report) is None: 703 raise self._never_seen_error("minerals") 704 return report.mineral_contents
The minerals left in a mineral field. 0 for anything else.
706 @property 707 def vespene_contents(self: Unit[UnitType.AnyVespeneGeyser | UnitType.GasBuilding]) -> int: 708 """The vespene left in a geyser, or in the gas building on it. 0 for anything else.""" 709 if (report := self._latest_visible_report) is None: 710 raise self._never_seen_error("vespene") 711 return report.vespene_contents
The vespene left in a geyser, or in the gas building on it. 0 for anything else.
713 @property 714 def buffs(self) -> frozenset[BuffId]: 715 """The buffs on the unit, but those every unit of its type wears for as long as it is listed, which say nothing 716 its type does not: a parasitic bomb left behind reads none.""" 717 if (report := self._latest_visible_report) is None: 718 raise self._never_seen_error("buffs") 719 return frozenset(BuffId._read_each(report.buff_ids))
The buffs on the unit, but those every unit of its type wears for as long as it is listed, which say nothing its type does not: a parasitic bomb left behind reads none.
721 def has_buff(self, buff_ids: BuffId | Collection[BuffId]) -> bool: 722 """Whether `buff_ids`, one buff or any of several, is among the unit's `buffs`. Raises `NotReportedError` for a 723 unit never shown visible, as `buffs` does.""" 724 unit_buffs = self.buffs 725 if isinstance(buff_ids, BuffId): 726 return buff_ids in unit_buffs 727 return not unit_buffs.isdisjoint(buff_ids)
Whether buff_ids, one buff or any of several, is among the unit's buffs. Raises NotReportedError for a
unit never shown visible, as buffs does.
729 @property 730 def is_carrying_resource(self) -> bool: 731 """Whether the unit carries minerals or gas, as its buffs show: false for a worker carrying gas from a rich 732 geyser, which the game gives no buff (in game). Raises `NotReportedError` for a unit never shown visible, as 733 `buffs` does.""" 734 return self.has_buff(_CARRYING_RESOURCE_BUFFS)
Whether the unit carries minerals or gas, as its buffs show: false for a worker carrying gas from a rich
geyser, which the game gives no buff (in game). Raises NotReportedError for a unit never shown visible, as
buffs does.
736 @property 737 def is_carrying_minerals(self) -> bool: 738 """Whether the unit carries minerals, from a plain field or a rich one, as its buffs show. Raises 739 `NotReportedError` for a unit never shown visible, as `buffs` does.""" 740 return self.has_buff(_CARRYING_MINERALS_BUFFS)
Whether the unit carries minerals, from a plain field or a rich one, as its buffs show. Raises
NotReportedError for a unit never shown visible, as buffs does.
742 @property 743 def is_carrying_gas(self) -> bool: 744 """Whether the unit carries gas, as its buffs show: false for a worker carrying gas from a rich geyser, which 745 the game gives no buff (in game). Raises `NotReportedError` for a unit never shown visible, as `buffs` does.""" 746 return self.has_buff(BuffId.CARRYING_GAS)
Whether the unit carries gas, as its buffs show: false for a worker carrying gas from a rich geyser, which
the game gives no buff (in game). Raises NotReportedError for a unit never shown visible, as buffs does.
750 @property 751 def type_data(self) -> UnitTypeData: 752 """The game's table entry for the unit's type, before any upgrade.""" 753 return self._tracker.game_data.units[self.type_id]
The game's table entry for the unit's type, before any upgrade.
755 @property 756 def weapons(self) -> tuple[Weapon, ...]: 757 """The unit type's weapons with its owner's upgrades applied: this player's upgrades for its own units, 758 `Api.enemy.upgrades` for the enemy's, and none for anyone else's. `active_weapons` are those it can fire now.""" 759 return self._tracker.upgrade_tracker.upgraded_type(self).weapons
The unit type's weapons with its owner's upgrades applied: this player's upgrades for its own units,
Api.enemy.upgrades for the enemy's, and none for anyone else's. active_weapons are those it can fire now.
767 @property 768 def armor(self) -> float: 769 """The unit's base armor plus the armor its upgrades add: as the unit reports it when `is_visible`, and 770 otherwise the more of what it last reported visible and what its owner is known to have.""" 771 return self._tracker.upgrade_tracker.armor_of(self)
The unit's base armor plus the armor its upgrades add: as the unit reports it when is_visible, and
otherwise the more of what it last reported visible and what its owner is known to have.
773 @property 774 def shield_armor(self) -> float: 775 """The armor of the unit's shields: its shield upgrade level as it reports it when `is_visible`, and otherwise 776 the more of what it last reported visible and the levels its owner is known to have; 0 for a unit without 777 shields. 778 779 The game's tables do not hold this. `docs/reference/game-behavior/damage-and-buffs.md` has what a level was 780 measured to take off a hit. 781 """ 782 return self._tracker.upgrade_tracker.shield_armor_of(self)
The armor of the unit's shields: its shield upgrade level as it reports it when is_visible, and otherwise
the more of what it last reported visible and the levels its owner is known to have; 0 for a unit without
shields.
The game's tables do not hold this. docs/reference/game-behavior/damage-and-buffs.md has what a level was
measured to take off a hit.
784 @property 785 def is_structure(self) -> bool: 786 """Whether the game's tables give the unit's type the structure attribute.""" 787 return Attribute.STRUCTURE in self.type_data.attributes
Whether the game's tables give the unit's type the structure attribute.
789 @property 790 def is_ground_structure(self) -> bool: 791 """Whether the unit is a structure standing on the ground: one not lifted, and one remembered out of sight, 792 whose flying the game does not report.""" 793 return self.is_structure and (self._latest_report.display_type == _IN_FOG or not self.is_flying)
Whether the unit is a structure standing on the ground: one not lifted, and one remembered out of sight, whose flying the game does not report.
795 def distance_to(self, other: PointLike | Unit[Any]) -> float: 796 """The distance from this unit's position to `other`, a point or another unit's position.""" 797 return self._position.distance_to(other._position if isinstance(other, Unit) else other)
The distance from this unit's position to other, a point or another unit's position.
799 @property 800 def footprint(self) -> Footprint | None: 801 """The tiles it covers where it stands: its type's footprint, or for a type of the map's own, of no race, that 802 does not move and has none measured, the square its radius spans. `None` for a unit that covers none, a force 803 field and a critter among them.""" 804 row = self._tracker.game_data.units.get(self.type_id) 805 if row is None: 806 return None 807 if row.footprint is None and row.race is Race.NONE and not row.speed: 808 side = round(2 * self.radius) 809 if not side: 810 return None 811 if self._radius_footprint is None or self._radius_footprint.width != side: 812 self._radius_footprint = Footprint.square(side) 813 return self._radius_footprint 814 return row.footprint
The tiles it covers where it stands: its type's footprint, or for a type of the map's own, of no race, that
does not move and has none measured, the square its radius spans. None for a unit that covers none, a force
field and a critter among them.
816 @property 817 def required_repair_cost(self) -> Cost | None: 818 """What one SCV's repair of the unit from its health now to whole takes: the time and resources of 819 `total_repair_cost` for the share of its health missing, each rounded up to a whole one, steps for the time (in 820 game), and nothing for a unit whole. `None` wherever `total_repair_cost` is.""" 821 return self._repair_cost_of(self.health_max - self.health)
What one SCV's repair of the unit from its health now to whole takes: the time and resources of
total_repair_cost for the share of its health missing, each rounded up to a whole one, steps for the time (in
game), and nothing for a unit whole. None wherever total_repair_cost is.
823 @property 824 def total_repair_cost(self) -> Cost | None: 825 """What one SCV's repair of a unit of this type from no health to whole takes: the time its type costs, but 826 for a MULE, an auto-turret, a widow mine and an add-on standing on its own, and a quarter of the resources its 827 type costs, each rounded up, with no supply (in game). `None` for a structure under construction, which an SCV 828 is refused, and for any type but a Terran mechanical one. `docs/reference/game-behavior/damage-and-buffs.md` 829 has what was measured.""" 830 return self._repair_cost_of(self.health_max)
What one SCV's repair of a unit of this type from no health to whole takes: the time its type costs, but
for a MULE, an auto-turret, a widow mine and an add-on standing on its own, and a quarter of the resources its
type costs, each rounded up, with no supply (in game). None for a structure under construction, which an SCV
is refused, and for any type but a Terran mechanical one. docs/reference/game-behavior/damage-and-buffs.md
has what was measured.
832 @property 833 def is_repairable(self) -> bool: 834 """Whether `total_repair_cost` gives a cost: whether the unit is a complete Terran mechanical one, whoever's it 835 is, an enemy's included. Raises `NotReportedError` for a Terran mechanical unit never 836 shown visible, whose build progress the game never reported.""" 837 return self.total_repair_cost is not None
Whether total_repair_cost gives a cost: whether the unit is a complete Terran mechanical one, whoever's it
is, an enemy's included. Raises NotReportedError for a Terran mechanical unit never
shown visible, whose build progress the game never reported.
839 def time_to_face( 840 self, target: PointLike | Unit[Any], *, facing_tolerance: float = _DEFAULT_FACING_TOLERANCE 841 ) -> GameTime | None: 842 """The time the unit takes to turn to face `target`, a point or another unit: the angle to turn over its type's 843 `turn_rate`, rounded up to a whole step (in game); zero if it faces it already, to within `facing_tolerance` 844 radians, a degree unless given. Counted from the step its turn begins, which an order sets off a step after it 845 in a game stepped by the bot, and may set off later in a realtime one, as on the ladder. `None` wherever 846 `turn_rate` is: for a type whose facing the game never changes and for one that does not move. 847 `docs/reference/game-behavior/units.md` has what was measured.""" 848 if (turn_rate := self.type_data.turn_rate) is None: 849 return None 850 target_position = target._position if isinstance(target, Unit) else target 851 if self._position.distance_to(target_position) == 0: 852 return GameTime.ZERO 853 bearing = self._position.angle_to(target_position) 854 angle_to_turn = abs((bearing - self.facing + math.pi) % math.tau - math.pi) 855 if angle_to_turn <= facing_tolerance: 856 return GameTime.ZERO 857 return GameTime(steps=math.ceil(angle_to_turn / turn_rate))
The time the unit takes to turn to face target, a point or another unit: the angle to turn over its type's
turn_rate, rounded up to a whole step (in game); zero if it faces it already, to within facing_tolerance
radians, a degree unless given. Counted from the step its turn begins, which an order sets off a step after it
in a game stepped by the bot, and may set off later in a realtime one, as on the ladder. None wherever
turn_rate is: for a type whose facing the game never changes and for one that does not move.
docs/reference/game-behavior/units.md has what was measured.
877 @property 878 def active_weapons(self) -> tuple[Weapon, ...]: 879 """The weapons of `weapons` the unit can fire now: all of them, but none for an oracle whose beam is off, which 880 wears `BuffId.ORACLE_PULSAR_BEAM` exactly while it is on (in game). Raises `NotReportedError` for an oracle 881 never shown visible.""" 882 if self.type_id is UnitTypeId.ORACLE and BuffId.ORACLE_PULSAR_BEAM not in self.buffs: 883 return () 884 return self.weapons
The weapons of weapons the unit can fire now: all of them, but none for an oracle whose beam is off, which
wears BuffId.ORACLE_PULSAR_BEAM exactly while it is on (in game). Raises NotReportedError for an oracle
never shown visible.
886 @property 887 def ground_weapon(self) -> Weapon | None: 888 """The weapon of `active_weapons` that fires at the ground, alone or with the air, or `None`. No type has two 889 that do (corpus). Raises as `active_weapons` does.""" 890 return self._weapon_firing_at(TargetDomain.GROUND)
The weapon of active_weapons that fires at the ground, alone or with the air, or None. No type has two
that do (corpus). Raises as active_weapons does.
892 @property 893 def air_weapon(self) -> Weapon | None: 894 """The weapon of `active_weapons` that fires at the air, alone or with the ground, or `None`, as 895 `ground_weapon` is for the ground.""" 896 return self._weapon_firing_at(TargetDomain.AIR)
The weapon of active_weapons that fires at the air, alone or with the ground, or None, as
ground_weapon is for the ground.
898 @property 899 def ground_range(self) -> float: 900 """The range of `ground_weapon`, with its owner's upgrades, or 0 without one.""" 901 weapon = self.ground_weapon 902 return 0.0 if weapon is None else weapon.range
The range of ground_weapon, with its owner's upgrades, or 0 without one.
904 @property 905 def air_range(self) -> float: 906 """The range of `air_weapon`, with its owner's upgrades, or 0 without one.""" 907 weapon = self.air_weapon 908 return 0.0 if weapon is None else weapon.range
The range of air_weapon, with its owner's upgrades, or 0 without one.
910 @property 911 def ground_damage(self) -> float: 912 """What one attack of `ground_weapon` does before bonuses and armor, its `total_damage`, or 0 without 913 one. A hallucination's counts; `damage_against` is what an attack takes off a target.""" 914 weapon = self.ground_weapon 915 return 0.0 if weapon is None else weapon.total_damage
What one attack of ground_weapon does before bonuses and armor, its total_damage, or 0 without
one. A hallucination's counts; damage_against is what an attack takes off a target.
917 @property 918 def air_damage(self) -> float: 919 """What one attack of `air_weapon` does before bonuses and armor, as `ground_damage` is for the ground.""" 920 weapon = self.air_weapon 921 return 0.0 if weapon is None else weapon.total_damage
What one attack of air_weapon does before bonuses and armor, as ground_damage is for the ground.
923 @property 924 def ground_dps(self) -> float: 925 """The `dps` of `ground_weapon`, per second of the game's Faster speed with the mean attack delay, before 926 bonuses, armor and buffs, or 0 without one. A hallucination's counts; `dps_against` is what a target takes.""" 927 weapon = self.ground_weapon 928 return 0.0 if weapon is None else weapon.dps
The dps of ground_weapon, per second of the game's Faster speed with the mean attack delay, before
bonuses, armor and buffs, or 0 without one. A hallucination's counts; dps_against is what a target takes.
930 @property 931 def air_dps(self) -> float: 932 """The `dps` of `air_weapon`, as `ground_dps` is for the ground.""" 933 weapon = self.air_weapon 934 return 0.0 if weapon is None else weapon.dps
The dps of air_weapon, as ground_dps is for the ground.
936 @property 937 def is_melee(self) -> bool: 938 """Whether the unit fires at the ground from no farther than 1: its `ground_range` above 0 and at most 1, as a 939 zealot's and a zergling's are.""" 940 return 0.0 < self.ground_range <= 1.0
Whether the unit fires at the ground from no farther than 1: its ground_range above 0 and at most 1, as a
zealot's and a zergling's are.
948 def weapon_against(self, target: Unit[Any]) -> Weapon | None: 949 """The weapon of `active_weapons` this unit fires at `target`: one that hits the air for a target that flies, 950 and one that hits the ground for a target on it, or failing that, for a colossus, one that hits the air, as a 951 viking's did (in game). `None` if it has none that hits `target`, an oracle whose beam is off among them. 952 953 Raises `NotReportedError` for a target remembered in the fog and never seen visible, as `is_flying` does, and 954 for an oracle never shown visible. 955 """ 956 weapons = self.active_weapons 957 if target.is_flying: 958 return next((weapon for weapon in weapons if weapon.target_domain is not TargetDomain.GROUND), None) 959 on_the_ground = next((weapon for weapon in weapons if weapon.target_domain is not TargetDomain.AIR), None) 960 if on_the_ground is None and target.type_id in _GROUND_TYPES_HIT_FROM_THE_AIR: 961 return next((weapon for weapon in weapons if weapon.target_domain is TargetDomain.AIR), None) 962 return on_the_ground
The weapon of active_weapons this unit fires at target: one that hits the air for a target that flies,
and one that hits the ground for a target on it, or failing that, for a colossus, one that hits the air, as a
viking's did (in game). None if it has none that hits target, an oracle whose beam is off among them.
Raises NotReportedError for a target remembered in the fog and never seen visible, as is_flying does, and
for an oracle never shown visible.
964 def has_in_range(self, target: Unit[Any], *, margin: float = 0.0) -> bool: 965 """Whether `target` is within the reach of `weapon_against(target)`: their centers no farther apart than its 966 range, both radii and `margin`. False if this unit has no weapon against `target`. 967 968 That is where a unit that can move fires at another unit (in game). An attacker that cannot move, such as a 969 sieged tank or a spine crawler, fires from up to some 0.1 nearer, and any attacker fires at a structure from up 970 to some 0.26 nearer, so pass a negative `margin` to be sure the shot can land. Raises as `weapon_against` does. 971 """ 972 weapon = self.weapon_against(target) 973 return weapon is not None and self.distance_to(target) <= weapon.range + self.radius + target.radius + margin
Whether target is within the reach of weapon_against(target): their centers no farther apart than its
range, both radii and margin. False if this unit has no weapon against target.
That is where a unit that can move fires at another unit (in game). An attacker that cannot move, such as a
sieged tank or a spine crawler, fires from up to some 0.1 nearer, and any attacker fires at a structure from up
to some 0.26 nearer, so pass a negative margin to be sure the shot can land. Raises as weapon_against does.
975 def damage_against(self, target: Unit[Any]) -> float: 976 """What one attack of `weapon_against(target)` takes off `target`'s shields and health as they stand, every hit 977 of it counted, as `Weapon.damage_against` works it out from the target's attributes, `armor`, `shield_armor` 978 and `shield`. 0 if 979 this unit has no weapon against it or is a hallucination, which does no damage (stated). An enemy's reads as 980 one only once revealed, as `is_hallucination` has it. No buff on either unit counts. 981 982 Raises `NotReportedError` as `weapon_against` does, and for a unit of the two never shown visible, whose 983 shields or hallucination the game never reported. 984 """ 985 weapon = self.weapon_against(target) 986 return 0.0 if weapon is None or self.is_hallucination else _damage_of_one_attack(weapon, target)
What one attack of weapon_against(target) takes off target's shields and health as they stand, every hit
of it counted, as Weapon.damage_against works it out from the target's attributes, armor, shield_armor
and shield. 0 if
this unit has no weapon against it or is a hallucination, which does no damage (stated). An enemy's reads as
one only once revealed, as is_hallucination has it. No buff on either unit counts.
Raises NotReportedError as weapon_against does, and for a unit of the two never shown visible, whose
shields or hallucination the game never reported.
988 def bonus_damage_against(self, target: Unit[Any]) -> float: 989 """The bonus damage one attack of `weapon_against(target)` does for `target`'s attributes, before armor: its 990 `Weapon.bonus_per_hit_against` them, times its attacks. 0 if this unit has no weapon against it. A 991 hallucination's counts, as for `ground_damage`. Raises `NotReportedError` as `weapon_against` does.""" 992 weapon = self.weapon_against(target) 993 if weapon is None: 994 return 0.0 995 return weapon.bonus_per_hit_against(target.type_data.attributes) * weapon.attacks
The bonus damage one attack of weapon_against(target) does for target's attributes, before armor: its
Weapon.bonus_per_hit_against them, times its attacks. 0 if this unit has no weapon against it. A
hallucination's counts, as for ground_damage. Raises NotReportedError as weapon_against does.
997 def dps_against(self, target: Unit[Any]) -> float: 998 """`damage_against(target)` per second of real time at the game's Faster speed, with `weapon_against(target)` 999 attacking as often as the buffs on this unit have it: stim makes a marine's and a marauder's 1.5 times as often 1000 (in game). 0 where `damage_against` is. 1001 1002 Raises `NotReportedError` as `damage_against` does. 1003 """ 1004 weapon = self.weapon_against(target) 1005 if weapon is None or self.is_hallucination: 1006 return 0.0 1007 damage = _damage_of_one_attack(weapon, target) 1008 if (report := self._latest_visible_report) is None: 1009 raise self._never_seen_error("buffs") 1010 # What speeds an attack divides the base cooldown, and leaves the random delay as it is (in game). 1011 attack_speed_multiplier = math.prod(_ATTACK_SPEED_BY_RAW_BUFF.get(buff, 1.0) for buff in report.buff_ids) 1012 # In plain steps, which spares two `GameTime`s a call in a targeting loop. 1013 cooldown_steps = weapon.base_cooldown.steps / attack_speed_multiplier + weapon.mean_delay.steps 1014 return damage * STEPS_PER_SECOND / cooldown_steps
damage_against(target) per second of real time at the game's Faster speed, with weapon_against(target)
attacking as often as the buffs on this unit have it: stim makes a marine's and a marauder's 1.5 times as often
(in game). 0 where damage_against is.
Raises NotReportedError as damage_against does.
15@final 16class UnitDict[K: Unit[Any], V](MutableMapping[K, V]): 17 """A value for each unit, as a dict keyed by unit holds one, that forgets a unit once it is dead: a bot's own data 18 for its units, such as a role or the mineral field a worker mines. 19 20 A unit is the same key for the whole game, however often the game changes its tag. A dead key reads as absent 21 wherever it is read: a lookup drops its entry, and iterating, `len` and the views skip it, so a unit's value cannot 22 be read in the turn it dies. A unit is dead once `is_dead` says so: an enemy's unit that dies out of sight stays a 23 key until NachOS finds it dead, and a dead unit held as a value stays. Storing a dead unit is not refused, and no 24 read sees it. A unit a neural parasite takes over changes class in place, so an `OwnUnit` key can be the enemy's 25 while it lasts. In a replay played back with the fog off, `api.units` and `api.all_units` hold different objects 26 for one unit, each a key of its own. 27 """ 28 29 __slots__ = ("_values",) 30 31 def __init__(self, values: Mapping[K, V] | Iterable[tuple[K, V]] = (), /) -> None: 32 """Hold `values`: a mapping, or pairs of a unit and its value.""" 33 self._values: dict[K, V] = {} 34 self.update(values) 35 36 def __repr__(self) -> str: 37 return f"UnitDict({dict(self.items())!r})" 38 39 def __getitem__(self, unit: K, /) -> V: 40 value = self._values[unit] 41 if unit._dead: 42 del self._values[unit] 43 raise KeyError(unit) 44 return value 45 46 def __setitem__(self, unit: K, value: V, /) -> None: 47 self._values[unit] = value 48 49 def __delitem__(self, unit: K, /) -> None: 50 del self._values[unit] 51 if unit._dead: 52 raise KeyError(unit) 53 54 def __contains__(self, unit: object, /) -> bool: 55 values = self._values 56 if unit not in values: 57 return False 58 # A key, so a unit; `cast` would cost a call on every lookup. 59 key: K = unit # pyright: ignore[reportAssignmentType] 60 if key._dead: 61 del values[key] 62 return False 63 return True 64 65 def __iter__(self) -> Iterator[K]: 66 self._forget_dead_units() 67 return iter(self._values) 68 69 def __len__(self) -> int: 70 self._forget_dead_units() 71 return len(self._values) 72 73 def __bool__(self) -> bool: 74 return any(not unit._dead for unit in self._values) 75 76 def clear(self) -> None: 77 """Forget every unit.""" 78 self._values.clear() 79 80 def copy(self) -> UnitDict[K, V]: 81 """A new `UnitDict` of the living units with their values.""" 82 self._forget_dead_units() 83 copied: UnitDict[K, V] = UnitDict() 84 copied._values = dict(self._values) 85 return copied 86 87 __copy__ = copy 88 89 @overload 90 def get(self, unit: K, /) -> V | None: ... 91 92 @overload 93 def get(self, unit: K, default: V, /) -> V: ... 94 95 @overload 96 def get[T](self, unit: K, default: T, /) -> V | T: ... 97 98 def get(self, unit: K, default: Any = None, /) -> Any: 99 """The value of `unit`, or `default` if it has none or is dead.""" 100 value = self._values.get(unit, _NO_ENTRY) 101 if value is _NO_ENTRY: 102 return default 103 if unit._dead: 104 del self._values[unit] 105 return default 106 return value 107 108 def items(self) -> ItemsView[K, V]: 109 """Each living unit with its value.""" 110 return _LivingUnitItems(self) 111 112 def values(self) -> ValuesView[V]: 113 """The value of each living unit.""" 114 return _LivingUnitValues(self) 115 116 def _forget_dead_units(self) -> None: 117 """Drop the entries of the units now dead.""" 118 values = self._values 119 for unit in [unit for unit in values if unit._dead]: 120 del values[unit]
A value for each unit, as a dict keyed by unit holds one, that forgets a unit once it is dead: a bot's own data for its units, such as a role or the mineral field a worker mines.
A unit is the same key for the whole game, however often the game changes its tag. A dead key reads as absent
wherever it is read: a lookup drops its entry, and iterating, len and the views skip it, so a unit's value cannot
be read in the turn it dies. A unit is dead once is_dead says so: an enemy's unit that dies out of sight stays a
key until NachOS finds it dead, and a dead unit held as a value stays. Storing a dead unit is not refused, and no
read sees it. A unit a neural parasite takes over changes class in place, so an OwnUnit key can be the enemy's
while it lasts. In a replay played back with the fog off, api.units and api.all_units hold different objects
for one unit, each a key of its own.
31 def __init__(self, values: Mapping[K, V] | Iterable[tuple[K, V]] = (), /) -> None: 32 """Hold `values`: a mapping, or pairs of a unit and its value.""" 33 self._values: dict[K, V] = {} 34 self.update(values)
Hold values: a mapping, or pairs of a unit and its value.
80 def copy(self) -> UnitDict[K, V]: 81 """A new `UnitDict` of the living units with their values.""" 82 self._forget_dead_units() 83 copied: UnitDict[K, V] = UnitDict() 84 copied._values = dict(self._values) 85 return copied
A new UnitDict of the living units with their values.
98 def get(self, unit: K, default: Any = None, /) -> Any: 99 """The value of `unit`, or `default` if it has none or is dead.""" 100 value = self._values.get(unit, _NO_ENTRY) 101 if value is _NO_ENTRY: 102 return default 103 if unit._dead: 104 del self._values[unit] 105 return default 106 return value
The value of unit, or default if it has none or is dead.
11class UnitIdsExhaustedError(NachOSError, OverflowError): 12 """A game has seen more units of one alliance than its ids can number."""
A game has seen more units of one alliance than its ids can number.
31@final 32class Units(Sequence[U]): 33 """An immutable, ordered collection of units. Filters keep the order. 34 35 Every filter returns a new collection. A query that picks the nearest unit, such as `closest_to`, raises 36 `ValueError` on an empty collection; `structure_at` answers `None` where no structure stands. Two collections are 37 equal, and hash alike, when they hold the same units in the same order; a collection never equals a tuple or a 38 list. 39 """ 40 41 __slots__ = ("_by_id", "_units") 42 43 _units: tuple[U, ...] 44 _by_id: dict[int, U] | None 45 46 def __init__(self, units: Iterable[U] = ()) -> None: 47 self._units = tuple(units) 48 self._by_id = None 49 50 @classmethod 51 def combined[V: Unit[Any]](cls, *collections: Iterable[V]) -> Units[V]: 52 """Every unit of `collections` in one collection, in order, each unit at its first appearance. 53 54 Units are matched by id, so a unit in two collections appears once, and collections that overlap combine 55 cleanly. 56 """ 57 index: dict[int, V] = {} 58 for collection in collections: 59 for unit in collection: 60 if unit.id not in index: 61 index[unit.id] = unit 62 combined = Units(index.values()) 63 combined._by_id = index 64 return combined 65 66 def combined_with[V: Unit[Any]](self, units: V | Iterable[V]) -> Units[U | V]: 67 """These units and then `units`, one unit or many, each unit at its first appearance, matched by id as 68 `combined` matches them.""" 69 return Units.combined(self._units, _unit_tuple(units)) 70 71 def __len__(self) -> int: 72 return len(self._units) 73 74 def __iter__(self) -> Iterator[U]: 75 return iter(self._units) 76 77 @overload 78 def __getitem__(self, index: int) -> U: ... 79 80 @overload 81 def __getitem__(self, index: slice) -> Units[U]: ... 82 83 def __getitem__(self, index: int | slice) -> U | Units[U]: 84 if isinstance(index, slice): 85 return Units(self._units[index]) 86 return self._units[index] 87 88 def __contains__(self, unit: object) -> bool: 89 return unit in self._units 90 91 def __eq__(self, other: object) -> bool: 92 if not isinstance(other, Units): 93 return NotImplemented 94 return self._units == other._units 95 96 def __hash__(self) -> int: 97 return hash(self._units) 98 99 def __repr__(self) -> str: 100 return f"Units({list(self._units)!r})" 101 102 # By id. 103 104 def _index(self) -> dict[int, U]: 105 """The units by id, built on first use.""" 106 if self._by_id is None: 107 self._by_id = {unit.id: unit for unit in self._units} 108 return self._by_id 109 110 @property 111 def ids(self) -> frozenset[int]: 112 """The id of every unit.""" 113 return frozenset(self._index()) 114 115 def by_id(self, unit_id: int) -> U: 116 """The unit with `unit_id`. Raises `KeyError` if there is none.""" 117 return self._index()[unit_id] 118 119 def get(self, unit_id: int) -> U | None: 120 """The unit with `unit_id`, or `None` if there is none.""" 121 return self._index().get(unit_id) 122 123 def with_ids(self, unit_ids: int | Iterable[int]) -> Units[U]: 124 """The units whose id is `unit_ids`, one id, or in it, a collection of them.""" 125 wanted = {unit_ids} if isinstance(unit_ids, int) else set(unit_ids) 126 return Units(unit for unit in self._units if unit.id in wanted) 127 128 def without_ids(self, unit_ids: int | Iterable[int]) -> Units[U]: 129 """The units whose id is not `unit_ids`, one id, or not in it, a collection of them.""" 130 unwanted = {unit_ids} if isinstance(unit_ids, int) else set(unit_ids) 131 return Units(unit for unit in self._units if unit.id not in unwanted) 132 133 def without(self, units: Unit[Any] | Iterable[Unit[Any]]) -> Units[U]: 134 """These units, leaving out `units`, one unit or many, matched by NachOS id, so a structure remembered under a 135 new tag still matches.""" 136 return self.without_ids(unit.id for unit in _unit_tuple(units)) 137 138 # By what they are. 139 140 def filter(self, predicate: Callable[[U], bool]) -> Units[U]: 141 """The units for which `predicate` is true.""" 142 return Units(unit for unit in self._units if predicate(unit)) 143 144 @overload 145 def of_type[K: UnitType.AnyType]( 146 self: Units[OwnUnit[Any]], unit_type: type[K], /, *unit_types: type[K] 147 ) -> Units[OwnUnit[K]]: ... 148 149 @overload 150 def of_type[K: UnitType.AnyType]( 151 self: Units[Unit[Any]], unit_type: type[K], /, *unit_types: type[K] 152 ) -> Units[Unit[K]]: ... 153 154 @overload 155 def of_type( 156 self, unit_type: type[UnitType.AnyType] | UnitTypeId, /, *unit_types: type[UnitType.AnyType] | UnitTypeId 157 ) -> Units[U]: ... 158 159 @overload 160 def of_type(self, type_ids: Iterable[UnitTypeId], /) -> Units[U]: ... 161 162 def of_type( 163 self, 164 types: type[UnitType.AnyType] | UnitTypeId | Iterable[UnitTypeId], 165 /, 166 *unit_types: type[UnitType.AnyType] | UnitTypeId, 167 ) -> Units[Any]: 168 """The units of the given types, each a `UnitType`, a group of them, or a `UnitTypeId`, or of the 169 `UnitTypeId`s in one collection given alone. Typed as those types when every one is a `UnitType`; the 170 collection keeps its type otherwise. Raises `TypeError` for anything else. 171 """ 172 if isinstance(types, UnitTypeId) and not unit_types: 173 return Units(unit for unit in self._units if unit.type_id is types) 174 wanted = _type_ids_of(types, unit_types) 175 return Units(unit for unit in self._units if unit.type_id in wanted) 176 177 @overload 178 def excluding_type( 179 self, unit_type: type[UnitType.AnyType] | UnitTypeId, /, *unit_types: type[UnitType.AnyType] | UnitTypeId 180 ) -> Units[U]: ... 181 182 @overload 183 def excluding_type(self, type_ids: Iterable[UnitTypeId], /) -> Units[U]: ... 184 185 def excluding_type( 186 self, 187 types: type[UnitType.AnyType] | UnitTypeId | Iterable[UnitTypeId], 188 /, 189 *unit_types: type[UnitType.AnyType] | UnitTypeId, 190 ) -> Units[U]: 191 """The units not of any of the given types, taken as `of_type` takes them.""" 192 if isinstance(types, UnitTypeId) and not unit_types: 193 return Units(unit for unit in self._units if unit.type_id is not types) 194 unwanted = _type_ids_of(types, unit_types) 195 return Units(unit for unit in self._units if unit.type_id not in unwanted) 196 197 def _of_alliance(self, alliance: Alliance) -> Units[U]: 198 return Units(unit for unit in self._units if unit._raw_alliance == alliance) 199 200 @property 201 def own[K: UnitType.AnyType](self: Units[Unit[K]]) -> Units[OwnUnit[K]]: 202 """This player's units.""" 203 return Units(unit for unit in self._units if isinstance(unit, OwnUnit)) 204 205 @property 206 def allied(self) -> Units[U]: 207 """The units of this player's allies.""" 208 return self._of_alliance(Alliance.ALLY) 209 210 @property 211 def neutral(self) -> Units[U]: 212 """The map's own units.""" 213 return self._of_alliance(Alliance.NEUTRAL) 214 215 @property 216 def enemy(self) -> Units[U]: 217 """The enemies' units.""" 218 return self._of_alliance(Alliance.ENEMY) 219 220 @property 221 def structures(self) -> Units[U]: 222 """The structures, as `UnitType.Structure` has them: the types the game's tables give the structure 223 attribute.""" 224 return self._in_group(UnitType.Structure) 225 226 @property 227 def non_structures(self) -> Units[U]: 228 """The units that are not structures, those of `UnitType.NonStructure`: larvae, eggs and a sieged tank among 229 them, and not a lifted barracks.""" 230 return self._in_group(UnitType.NonStructure) 231 232 @property 233 def workers(self) -> Units[U]: 234 """The workers: SCVs, probes and drones, burrowed or not, as `UnitType.Worker` has them. A MULE is none.""" 235 return self._in_group(UnitType.Worker) 236 237 @property 238 def townhalls(self) -> Units[U]: 239 """The townhalls, a lifted command center among them, as `UnitType.Townhall` has them.""" 240 return self._in_group(UnitType.Townhall) 241 242 @property 243 def mineral_fields(self) -> Units[U]: 244 """The mineral fields of every kind, as `UnitType.AnyMineralField` has them.""" 245 return self._in_group(UnitType.AnyMineralField) 246 247 @property 248 def geysers(self) -> Units[U]: 249 """The vespene geysers of every kind, as `UnitType.AnyVespeneGeyser` has them.""" 250 return self._in_group(UnitType.AnyVespeneGeyser) 251 252 @property 253 def gas_buildings(self) -> Units[U]: 254 """The refineries, assimilators and extractors, as `UnitType.GasBuilding` has them.""" 255 return self._in_group(UnitType.GasBuilding) 256 257 def _in_group(self, group: type[UnitType.AnyType]) -> Units[U]: 258 """The units of a type in `group`.""" 259 wanted = group.type_ids 260 return Units(unit for unit in self._units if unit.type_id in wanted) 261 262 @property 263 def complete(self) -> Units[U]: 264 """The units that have finished building or warping in. Raises `NotReportedError` for a unit never shown 265 visible.""" 266 return Units(unit for unit in self._units if unit.is_complete) 267 268 @property 269 def not_complete(self) -> Units[U]: 270 """The units still building or warping in: those `complete` leaves out. Raises `NotReportedError` as it 271 does.""" 272 return Units(unit for unit in self._units if not unit.is_complete) 273 274 @property 275 def alive(self) -> Units[U]: 276 """The units not known to be dead, as `Unit.is_alive` has it.""" 277 return Units(unit for unit in self._units if unit.is_alive) 278 279 @property 280 def dead(self) -> Units[U]: 281 """The units known to be dead: those `alive` leaves out.""" 282 return Units(unit for unit in self._units if unit.is_dead) 283 284 @property 285 def listed(self) -> Units[U]: 286 """The units the last observation listed, as `Unit.is_listed` has it.""" 287 return Units(unit for unit in self._units if unit.is_listed) 288 289 @property 290 def not_listed(self) -> Units[U]: 291 """The units the last observation did not list: those `listed` leaves out.""" 292 return Units(unit for unit in self._units if not unit.is_listed) 293 294 @property 295 def visible(self) -> Units[U]: 296 """The units the last observation showed visible, as `Unit.is_visible` has it: in it, and seen, not cloaked or 297 detected.""" 298 return Units(unit for unit in self._units if unit.is_visible) 299 300 @property 301 def orderable[K: UnitType.AnyType](self: Units[Unit[K]]) -> Units[OwnUnit[K]]: 302 """The units this player can order now, as `Unit.is_orderable` has it.""" 303 return Units(unit for unit in self._units if isinstance(unit, OwnUnit) and unit.is_listed) 304 305 @property 306 def ground(self) -> Units[U]: 307 """The units on the ground: those not flying, and the structures remembered in the fog, whose flying the game 308 does not report, as `Unit.is_ground_structure` takes them.""" 309 return Units(unit for unit in self._units if _is_on_the_ground(unit)) 310 311 @property 312 def air(self) -> Units[U]: 313 """The units in the air: those `ground` leaves out.""" 314 return Units(unit for unit in self._units if not _is_on_the_ground(unit)) 315 316 @property 317 def idle[O: OwnUnit[Any]](self: Units[O]) -> Units[O]: 318 """This player's units without orders.""" 319 return Units(unit for unit in self._units if unit.is_idle) 320 321 def doing[O: OwnUnit[Any]](self: Units[O], abilities: AbilityId | Collection[AbilityId]) -> Units[O]: 322 """This player's units whose current order carries out `abilities`, one ability or any of several.""" 323 return Units(unit for unit in self._units if unit.is_doing(abilities)) 324 325 def with_buff(self, buff_ids: BuffId | Collection[BuffId]) -> Units[U]: 326 """The units with `buff_ids`, one buff or any of several, among their buffs. Raises `NotReportedError` for a 327 unit never shown visible.""" 328 return Units(unit for unit in self._units if unit.has_buff(buff_ids)) 329 330 # By what they can hit. 331 332 def having_in_range(self, target: Unit[Any], *, margin: float = 0.0) -> Units[U]: 333 """The units that have `target` in range of a weapon, as `Unit.has_in_range` has it. Raises 334 `NotReportedError` as it does.""" 335 return Units(unit for unit in self._units if unit.has_in_range(target, margin=margin)) 336 337 def in_range_of(self, attacker: Unit[Any], *, margin: float = 0.0) -> Units[U]: 338 """The units `attacker` has in range of a weapon, as `Unit.has_in_range` has it. Raises `NotReportedError` as 339 it does.""" 340 return Units(unit for unit in self._units if attacker.has_in_range(unit, margin=margin)) 341 342 # By where they are. Written as plain loops over each unit's position: measured three times faster than `min` 343 # with a key, and faster than building an array of positions, which would have to be rebuilt on every query 344 # since the units move. 345 346 def inside(self, areas: Area | Iterable[Area]) -> Units[U]: 347 """The units standing in `areas`: in one area, or in any of several.""" 348 if isinstance(areas, Area): 349 return Units(unit for unit in self._units if unit._position in areas) 350 regions = tuple(areas) 351 return Units(unit for unit in self._units if any(unit._position in region for region in regions)) 352 353 def outside(self, areas: Area | Iterable[Area]) -> Units[U]: 354 """The units standing in none of `areas`: those `inside` leaves out.""" 355 if isinstance(areas, Area): 356 return Units(unit for unit in self._units if unit._position not in areas) 357 regions = tuple(areas) 358 return Units(unit for unit in self._units if not any(unit._position in region for region in regions)) 359 360 def within(self, distance: float, *, of: PointLike | Unit[Any] | Iterable[PointLike | Unit[Any]]) -> Units[U]: 361 """The units at most `distance` from `of`, a point or a unit, or from any of several, measured between 362 positions. Raises `ValueError` for a distance that is negative or not a number.""" 363 if not distance >= 0: 364 raise ValueError(f"a distance is at least 0, not {distance}") 365 centers = _positions(of) 366 distance_squared = distance * distance 367 kept = [] 368 for unit in self._units: 369 position = unit._position 370 x, y = position[0], position[1] 371 for cx, cy in centers: 372 dx = x - cx 373 dy = y - cy 374 if dx * dx + dy * dy <= distance_squared: 375 kept.append(unit) 376 break 377 return Units(kept) 378 379 def beyond(self, distance: float, *, of: PointLike | Unit[Any] | Iterable[PointLike | Unit[Any]]) -> Units[U]: 380 """The units farther than `distance` from `of`, a point or a unit, and from every one of several: those 381 `within` leaves out. Raises `ValueError` as `within` does.""" 382 return self.without(self.within(distance, of=of)) 383 384 def sorted(self, key: Callable[[U], Any], *, reverse: bool = False) -> Units[U]: 385 """The units in the order of `key`, ascending unless `reverse`. Units of equal key keep their order.""" 386 return Units(sorted(self._units, key=key, reverse=reverse)) 387 388 def sorted_by_distance_to(self, point_or_unit: PointLike | Unit[Any]) -> Units[U]: 389 """The units from nearest to `point_or_unit`, a point or a unit's position, to furthest. Units at equal 390 distance keep their order.""" 391 x, y = _ground_position_of(point_or_unit) 392 distances = [] 393 for unit in self._units: 394 position = unit._position 395 dx = position[0] - x 396 dy = position[1] - y 397 distances.append(dx * dx + dy * dy) 398 order = sorted(range(len(distances)), key=distances.__getitem__) 399 return Units(self._units[index] for index in order) 400 401 def closest_n_to(self, count: int, point_or_unit: PointLike | Unit[Any]) -> Units[U]: 402 """The `count` units nearest to `point_or_unit`, a point or a unit's position, nearest first, or all of them if 403 there are fewer.""" 404 if count < 0: 405 raise ValueError(f"cannot pick {count} units") 406 return self.sorted_by_distance_to(point_or_unit)[:count] 407 408 def closest_to(self, point_or_unit: PointLike | Unit[Any]) -> U: 409 """The unit nearest to `point_or_unit`, a point or a unit's position. At equal distance, the first in the 410 collection: a unit in it is at distance 0 from itself, and is picked unless another on the same spot comes 411 first.""" 412 if not self._units: 413 raise ValueError("no units to choose from") 414 x, y = _ground_position_of(point_or_unit) 415 closest = self._units[0] 416 nearest = math.inf 417 for unit in self._units: 418 position = unit._position 419 dx = position[0] - x 420 dy = position[1] - y 421 distance = dx * dx + dy * dy 422 if distance < nearest: 423 nearest = distance 424 closest = unit 425 return closest 426 427 def closest_distance_to(self, point_or_unit: PointLike | Unit[Any]) -> float: 428 """The distance from `point_or_unit`, a point or a unit's position, to the nearest unit's position.""" 429 if not self._units: 430 raise ValueError("no units to measure to") 431 x, y = _ground_position_of(point_or_unit) 432 nearest = math.inf 433 for unit in self._units: 434 position = unit._position 435 dx = position[0] - x 436 dy = position[1] - y 437 distance = dx * dx + dy * dy 438 if distance < nearest: 439 nearest = distance 440 return math.sqrt(nearest) 441 442 def structure_at(self, point: PointLike | Tile) -> U | None: 443 """The structure on the ground whose footprint holds `point`, a tile reading as its center, or `None` if none of 444 these does. Of one in sight and a snapshot over the same ground, the one in sight; a lifted structure covers no 445 ground.""" 446 tile = Tile.at(point) 447 x, y = _ground_position_of(tile.center if isinstance(point, Tile) else point) 448 remembered = None 449 for unit in self._units: 450 position = unit._position 451 if abs(position[0] - x) > _FOOTPRINT_REACH or abs(position[1] - y) > _FOOTPRINT_REACH: 452 continue 453 if not unit.is_ground_structure or (footprint := unit.footprint) is None: 454 continue 455 if tile not in footprint.tiles(at=position): 456 continue 457 if unit.is_listed and unit.visibility.in_sight: 458 return unit 459 if remembered is None: 460 remembered = unit 461 return remembered 462 463 @property 464 def center(self) -> Point: 465 """The mean of the units' positions.""" 466 if not self._units: 467 raise ValueError("no units to find the center of") 468 x = y = 0.0 469 for unit in self._units: 470 position = unit._position 471 x += position[0] 472 y += position[1] 473 count = len(self._units) 474 return Point((x / count, y / count))
An immutable, ordered collection of units. Filters keep the order.
Every filter returns a new collection. A query that picks the nearest unit, such as closest_to, raises
ValueError on an empty collection; structure_at answers None where no structure stands. Two collections are
equal, and hash alike, when they hold the same units in the same order; a collection never equals a tuple or a
list.
50 @classmethod 51 def combined[V: Unit[Any]](cls, *collections: Iterable[V]) -> Units[V]: 52 """Every unit of `collections` in one collection, in order, each unit at its first appearance. 53 54 Units are matched by id, so a unit in two collections appears once, and collections that overlap combine 55 cleanly. 56 """ 57 index: dict[int, V] = {} 58 for collection in collections: 59 for unit in collection: 60 if unit.id not in index: 61 index[unit.id] = unit 62 combined = Units(index.values()) 63 combined._by_id = index 64 return combined
Every unit of collections in one collection, in order, each unit at its first appearance.
Units are matched by id, so a unit in two collections appears once, and collections that overlap combine cleanly.
66 def combined_with[V: Unit[Any]](self, units: V | Iterable[V]) -> Units[U | V]: 67 """These units and then `units`, one unit or many, each unit at its first appearance, matched by id as 68 `combined` matches them.""" 69 return Units.combined(self._units, _unit_tuple(units))
These units and then units, one unit or many, each unit at its first appearance, matched by id as
combined matches them.
110 @property 111 def ids(self) -> frozenset[int]: 112 """The id of every unit.""" 113 return frozenset(self._index())
The id of every unit.
115 def by_id(self, unit_id: int) -> U: 116 """The unit with `unit_id`. Raises `KeyError` if there is none.""" 117 return self._index()[unit_id]
The unit with unit_id. Raises KeyError if there is none.
119 def get(self, unit_id: int) -> U | None: 120 """The unit with `unit_id`, or `None` if there is none.""" 121 return self._index().get(unit_id)
The unit with unit_id, or None if there is none.
123 def with_ids(self, unit_ids: int | Iterable[int]) -> Units[U]: 124 """The units whose id is `unit_ids`, one id, or in it, a collection of them.""" 125 wanted = {unit_ids} if isinstance(unit_ids, int) else set(unit_ids) 126 return Units(unit for unit in self._units if unit.id in wanted)
The units whose id is unit_ids, one id, or in it, a collection of them.
128 def without_ids(self, unit_ids: int | Iterable[int]) -> Units[U]: 129 """The units whose id is not `unit_ids`, one id, or not in it, a collection of them.""" 130 unwanted = {unit_ids} if isinstance(unit_ids, int) else set(unit_ids) 131 return Units(unit for unit in self._units if unit.id not in unwanted)
The units whose id is not unit_ids, one id, or not in it, a collection of them.
133 def without(self, units: Unit[Any] | Iterable[Unit[Any]]) -> Units[U]: 134 """These units, leaving out `units`, one unit or many, matched by NachOS id, so a structure remembered under a 135 new tag still matches.""" 136 return self.without_ids(unit.id for unit in _unit_tuple(units))
These units, leaving out units, one unit or many, matched by NachOS id, so a structure remembered under a
new tag still matches.
140 def filter(self, predicate: Callable[[U], bool]) -> Units[U]: 141 """The units for which `predicate` is true.""" 142 return Units(unit for unit in self._units if predicate(unit))
The units for which predicate is true.
162 def of_type( 163 self, 164 types: type[UnitType.AnyType] | UnitTypeId | Iterable[UnitTypeId], 165 /, 166 *unit_types: type[UnitType.AnyType] | UnitTypeId, 167 ) -> Units[Any]: 168 """The units of the given types, each a `UnitType`, a group of them, or a `UnitTypeId`, or of the 169 `UnitTypeId`s in one collection given alone. Typed as those types when every one is a `UnitType`; the 170 collection keeps its type otherwise. Raises `TypeError` for anything else. 171 """ 172 if isinstance(types, UnitTypeId) and not unit_types: 173 return Units(unit for unit in self._units if unit.type_id is types) 174 wanted = _type_ids_of(types, unit_types) 175 return Units(unit for unit in self._units if unit.type_id in wanted)
185 def excluding_type( 186 self, 187 types: type[UnitType.AnyType] | UnitTypeId | Iterable[UnitTypeId], 188 /, 189 *unit_types: type[UnitType.AnyType] | UnitTypeId, 190 ) -> Units[U]: 191 """The units not of any of the given types, taken as `of_type` takes them.""" 192 if isinstance(types, UnitTypeId) and not unit_types: 193 return Units(unit for unit in self._units if unit.type_id is not types) 194 unwanted = _type_ids_of(types, unit_types) 195 return Units(unit for unit in self._units if unit.type_id not in unwanted)
The units not of any of the given types, taken as of_type takes them.
200 @property 201 def own[K: UnitType.AnyType](self: Units[Unit[K]]) -> Units[OwnUnit[K]]: 202 """This player's units.""" 203 return Units(unit for unit in self._units if isinstance(unit, OwnUnit))
This player's units.
205 @property 206 def allied(self) -> Units[U]: 207 """The units of this player's allies.""" 208 return self._of_alliance(Alliance.ALLY)
The units of this player's allies.
210 @property 211 def neutral(self) -> Units[U]: 212 """The map's own units.""" 213 return self._of_alliance(Alliance.NEUTRAL)
The map's own units.
215 @property 216 def enemy(self) -> Units[U]: 217 """The enemies' units.""" 218 return self._of_alliance(Alliance.ENEMY)
The enemies' units.
220 @property 221 def structures(self) -> Units[U]: 222 """The structures, as `UnitType.Structure` has them: the types the game's tables give the structure 223 attribute.""" 224 return self._in_group(UnitType.Structure)
The structures, as UnitType.Structure has them: the types the game's tables give the structure
attribute.
226 @property 227 def non_structures(self) -> Units[U]: 228 """The units that are not structures, those of `UnitType.NonStructure`: larvae, eggs and a sieged tank among 229 them, and not a lifted barracks.""" 230 return self._in_group(UnitType.NonStructure)
The units that are not structures, those of UnitType.NonStructure: larvae, eggs and a sieged tank among
them, and not a lifted barracks.
232 @property 233 def workers(self) -> Units[U]: 234 """The workers: SCVs, probes and drones, burrowed or not, as `UnitType.Worker` has them. A MULE is none.""" 235 return self._in_group(UnitType.Worker)
The workers: SCVs, probes and drones, burrowed or not, as UnitType.Worker has them. A MULE is none.
237 @property 238 def townhalls(self) -> Units[U]: 239 """The townhalls, a lifted command center among them, as `UnitType.Townhall` has them.""" 240 return self._in_group(UnitType.Townhall)
The townhalls, a lifted command center among them, as UnitType.Townhall has them.
242 @property 243 def mineral_fields(self) -> Units[U]: 244 """The mineral fields of every kind, as `UnitType.AnyMineralField` has them.""" 245 return self._in_group(UnitType.AnyMineralField)
The mineral fields of every kind, as UnitType.AnyMineralField has them.
247 @property 248 def geysers(self) -> Units[U]: 249 """The vespene geysers of every kind, as `UnitType.AnyVespeneGeyser` has them.""" 250 return self._in_group(UnitType.AnyVespeneGeyser)
The vespene geysers of every kind, as UnitType.AnyVespeneGeyser has them.
252 @property 253 def gas_buildings(self) -> Units[U]: 254 """The refineries, assimilators and extractors, as `UnitType.GasBuilding` has them.""" 255 return self._in_group(UnitType.GasBuilding)
The refineries, assimilators and extractors, as UnitType.GasBuilding has them.
262 @property 263 def complete(self) -> Units[U]: 264 """The units that have finished building or warping in. Raises `NotReportedError` for a unit never shown 265 visible.""" 266 return Units(unit for unit in self._units if unit.is_complete)
The units that have finished building or warping in. Raises NotReportedError for a unit never shown
visible.
268 @property 269 def not_complete(self) -> Units[U]: 270 """The units still building or warping in: those `complete` leaves out. Raises `NotReportedError` as it 271 does.""" 272 return Units(unit for unit in self._units if not unit.is_complete)
The units still building or warping in: those complete leaves out. Raises NotReportedError as it
does.
274 @property 275 def alive(self) -> Units[U]: 276 """The units not known to be dead, as `Unit.is_alive` has it.""" 277 return Units(unit for unit in self._units if unit.is_alive)
The units not known to be dead, as Unit.is_alive has it.
279 @property 280 def dead(self) -> Units[U]: 281 """The units known to be dead: those `alive` leaves out.""" 282 return Units(unit for unit in self._units if unit.is_dead)
The units known to be dead: those alive leaves out.
284 @property 285 def listed(self) -> Units[U]: 286 """The units the last observation listed, as `Unit.is_listed` has it.""" 287 return Units(unit for unit in self._units if unit.is_listed)
The units the last observation listed, as Unit.is_listed has it.
289 @property 290 def not_listed(self) -> Units[U]: 291 """The units the last observation did not list: those `listed` leaves out.""" 292 return Units(unit for unit in self._units if not unit.is_listed)
The units the last observation did not list: those listed leaves out.
294 @property 295 def visible(self) -> Units[U]: 296 """The units the last observation showed visible, as `Unit.is_visible` has it: in it, and seen, not cloaked or 297 detected.""" 298 return Units(unit for unit in self._units if unit.is_visible)
The units the last observation showed visible, as Unit.is_visible has it: in it, and seen, not cloaked or
detected.
300 @property 301 def orderable[K: UnitType.AnyType](self: Units[Unit[K]]) -> Units[OwnUnit[K]]: 302 """The units this player can order now, as `Unit.is_orderable` has it.""" 303 return Units(unit for unit in self._units if isinstance(unit, OwnUnit) and unit.is_listed)
The units this player can order now, as Unit.is_orderable has it.
305 @property 306 def ground(self) -> Units[U]: 307 """The units on the ground: those not flying, and the structures remembered in the fog, whose flying the game 308 does not report, as `Unit.is_ground_structure` takes them.""" 309 return Units(unit for unit in self._units if _is_on_the_ground(unit))
The units on the ground: those not flying, and the structures remembered in the fog, whose flying the game
does not report, as Unit.is_ground_structure takes them.
311 @property 312 def air(self) -> Units[U]: 313 """The units in the air: those `ground` leaves out.""" 314 return Units(unit for unit in self._units if not _is_on_the_ground(unit))
The units in the air: those ground leaves out.
316 @property 317 def idle[O: OwnUnit[Any]](self: Units[O]) -> Units[O]: 318 """This player's units without orders.""" 319 return Units(unit for unit in self._units if unit.is_idle)
This player's units without orders.
321 def doing[O: OwnUnit[Any]](self: Units[O], abilities: AbilityId | Collection[AbilityId]) -> Units[O]: 322 """This player's units whose current order carries out `abilities`, one ability or any of several.""" 323 return Units(unit for unit in self._units if unit.is_doing(abilities))
This player's units whose current order carries out abilities, one ability or any of several.
325 def with_buff(self, buff_ids: BuffId | Collection[BuffId]) -> Units[U]: 326 """The units with `buff_ids`, one buff or any of several, among their buffs. Raises `NotReportedError` for a 327 unit never shown visible.""" 328 return Units(unit for unit in self._units if unit.has_buff(buff_ids))
The units with buff_ids, one buff or any of several, among their buffs. Raises NotReportedError for a
unit never shown visible.
332 def having_in_range(self, target: Unit[Any], *, margin: float = 0.0) -> Units[U]: 333 """The units that have `target` in range of a weapon, as `Unit.has_in_range` has it. Raises 334 `NotReportedError` as it does.""" 335 return Units(unit for unit in self._units if unit.has_in_range(target, margin=margin))
The units that have target in range of a weapon, as Unit.has_in_range has it. Raises
NotReportedError as it does.
337 def in_range_of(self, attacker: Unit[Any], *, margin: float = 0.0) -> Units[U]: 338 """The units `attacker` has in range of a weapon, as `Unit.has_in_range` has it. Raises `NotReportedError` as 339 it does.""" 340 return Units(unit for unit in self._units if attacker.has_in_range(unit, margin=margin))
The units attacker has in range of a weapon, as Unit.has_in_range has it. Raises NotReportedError as
it does.
346 def inside(self, areas: Area | Iterable[Area]) -> Units[U]: 347 """The units standing in `areas`: in one area, or in any of several.""" 348 if isinstance(areas, Area): 349 return Units(unit for unit in self._units if unit._position in areas) 350 regions = tuple(areas) 351 return Units(unit for unit in self._units if any(unit._position in region for region in regions))
The units standing in areas: in one area, or in any of several.
353 def outside(self, areas: Area | Iterable[Area]) -> Units[U]: 354 """The units standing in none of `areas`: those `inside` leaves out.""" 355 if isinstance(areas, Area): 356 return Units(unit for unit in self._units if unit._position not in areas) 357 regions = tuple(areas) 358 return Units(unit for unit in self._units if not any(unit._position in region for region in regions))
The units standing in none of areas: those inside leaves out.
360 def within(self, distance: float, *, of: PointLike | Unit[Any] | Iterable[PointLike | Unit[Any]]) -> Units[U]: 361 """The units at most `distance` from `of`, a point or a unit, or from any of several, measured between 362 positions. Raises `ValueError` for a distance that is negative or not a number.""" 363 if not distance >= 0: 364 raise ValueError(f"a distance is at least 0, not {distance}") 365 centers = _positions(of) 366 distance_squared = distance * distance 367 kept = [] 368 for unit in self._units: 369 position = unit._position 370 x, y = position[0], position[1] 371 for cx, cy in centers: 372 dx = x - cx 373 dy = y - cy 374 if dx * dx + dy * dy <= distance_squared: 375 kept.append(unit) 376 break 377 return Units(kept)
The units at most distance from of, a point or a unit, or from any of several, measured between
positions. Raises ValueError for a distance that is negative or not a number.
379 def beyond(self, distance: float, *, of: PointLike | Unit[Any] | Iterable[PointLike | Unit[Any]]) -> Units[U]: 380 """The units farther than `distance` from `of`, a point or a unit, and from every one of several: those 381 `within` leaves out. Raises `ValueError` as `within` does.""" 382 return self.without(self.within(distance, of=of))
384 def sorted(self, key: Callable[[U], Any], *, reverse: bool = False) -> Units[U]: 385 """The units in the order of `key`, ascending unless `reverse`. Units of equal key keep their order.""" 386 return Units(sorted(self._units, key=key, reverse=reverse))
The units in the order of key, ascending unless reverse. Units of equal key keep their order.
388 def sorted_by_distance_to(self, point_or_unit: PointLike | Unit[Any]) -> Units[U]: 389 """The units from nearest to `point_or_unit`, a point or a unit's position, to furthest. Units at equal 390 distance keep their order.""" 391 x, y = _ground_position_of(point_or_unit) 392 distances = [] 393 for unit in self._units: 394 position = unit._position 395 dx = position[0] - x 396 dy = position[1] - y 397 distances.append(dx * dx + dy * dy) 398 order = sorted(range(len(distances)), key=distances.__getitem__) 399 return Units(self._units[index] for index in order)
The units from nearest to point_or_unit, a point or a unit's position, to furthest. Units at equal
distance keep their order.
401 def closest_n_to(self, count: int, point_or_unit: PointLike | Unit[Any]) -> Units[U]: 402 """The `count` units nearest to `point_or_unit`, a point or a unit's position, nearest first, or all of them if 403 there are fewer.""" 404 if count < 0: 405 raise ValueError(f"cannot pick {count} units") 406 return self.sorted_by_distance_to(point_or_unit)[:count]
The count units nearest to point_or_unit, a point or a unit's position, nearest first, or all of them if
there are fewer.
408 def closest_to(self, point_or_unit: PointLike | Unit[Any]) -> U: 409 """The unit nearest to `point_or_unit`, a point or a unit's position. At equal distance, the first in the 410 collection: a unit in it is at distance 0 from itself, and is picked unless another on the same spot comes 411 first.""" 412 if not self._units: 413 raise ValueError("no units to choose from") 414 x, y = _ground_position_of(point_or_unit) 415 closest = self._units[0] 416 nearest = math.inf 417 for unit in self._units: 418 position = unit._position 419 dx = position[0] - x 420 dy = position[1] - y 421 distance = dx * dx + dy * dy 422 if distance < nearest: 423 nearest = distance 424 closest = unit 425 return closest
The unit nearest to point_or_unit, a point or a unit's position. At equal distance, the first in the
collection: a unit in it is at distance 0 from itself, and is picked unless another on the same spot comes
first.
427 def closest_distance_to(self, point_or_unit: PointLike | Unit[Any]) -> float: 428 """The distance from `point_or_unit`, a point or a unit's position, to the nearest unit's position.""" 429 if not self._units: 430 raise ValueError("no units to measure to") 431 x, y = _ground_position_of(point_or_unit) 432 nearest = math.inf 433 for unit in self._units: 434 position = unit._position 435 dx = position[0] - x 436 dy = position[1] - y 437 distance = dx * dx + dy * dy 438 if distance < nearest: 439 nearest = distance 440 return math.sqrt(nearest)
The distance from point_or_unit, a point or a unit's position, to the nearest unit's position.
442 def structure_at(self, point: PointLike | Tile) -> U | None: 443 """The structure on the ground whose footprint holds `point`, a tile reading as its center, or `None` if none of 444 these does. Of one in sight and a snapshot over the same ground, the one in sight; a lifted structure covers no 445 ground.""" 446 tile = Tile.at(point) 447 x, y = _ground_position_of(tile.center if isinstance(point, Tile) else point) 448 remembered = None 449 for unit in self._units: 450 position = unit._position 451 if abs(position[0] - x) > _FOOTPRINT_REACH or abs(position[1] - y) > _FOOTPRINT_REACH: 452 continue 453 if not unit.is_ground_structure or (footprint := unit.footprint) is None: 454 continue 455 if tile not in footprint.tiles(at=position): 456 continue 457 if unit.is_listed and unit.visibility.in_sight: 458 return unit 459 if remembered is None: 460 remembered = unit 461 return remembered
The structure on the ground whose footprint holds point, a tile reading as its center, or None if none of
these does. Of one in sight and a snapshot over the same ground, the one in sight; a lifted structure covers no
ground.
463 @property 464 def center(self) -> Point: 465 """The mean of the units' positions.""" 466 if not self._units: 467 raise ValueError("no units to find the center of") 468 x = y = 0.0 469 for unit in self._units: 470 position = unit._position 471 x += position[0] 472 y += position[1] 473 count = len(self._units) 474 return Point((x / count, y / count))
The mean of the units' positions.
7class UnknownTagError(NachOSError, LookupError): 8 """The game named a unit by a tag it has never reported a unit under."""
The game named a unit by a tag it has never reported a unit under.
34class Visibility(ReadableIntEnum): 35 """How much of a unit this player can see.""" 36 37 VISIBLE = raw_pb2.DisplayType.Visible 38 """In sight and seen: not cloaked, or detected.""" 39 IN_FOG = raw_pb2.DisplayType.Snapshot 40 """A structure out of sight, remembered where it was last seen.""" 41 INVISIBLE = raw_pb2.DisplayType.Hidden 42 """In sight, but cloaked or burrowed and undetected: an enemy observer nothing detects (in game), and an enemy's 43 burrowed widow mine (corpus). An enemy's burrowed zergling nothing detects is not listed at all (in game).""" 44 45 @property 46 def in_sight(self) -> bool: 47 """Whether the unit is in sight: visible, or invisible.""" 48 return self is not Visibility.IN_FOG
How much of a unit this player can see.
In sight, but cloaked or burrowed and undetected: an enemy observer nothing detects (in game), and an enemy's burrowed widow mine (corpus). An enemy's burrowed zergling nothing detects is not listed at all (in game).
67class VitalType(Enum): 68 """A vital of a unit, health, shields or energy, as an amount or as a fraction of its maximum. 69 70 A unit without shields or energy, whose maximum is 0, has neither to read. 71 """ 72 73 HEALTH = "health" 74 SHIELD = "shield" 75 LIFE = "life" 76 """Health and shields together.""" 77 ENERGY = "energy" 78 HEALTH_FRACTION = "health fraction" 79 SHIELD_FRACTION = "shield fraction" 80 LIFE_FRACTION = "life fraction" 81 """Health and shields together, as a fraction of their combined maximum.""" 82 ENERGY_FRACTION = "energy fraction" 83 84 @property 85 def is_fraction(self) -> bool: 86 """Whether the vital is a fraction of its maximum, from 0 to 1.""" 87 return self.value.endswith("fraction")
A vital of a unit, health, shields or energy, as an amount or as a fraction of its maximum.
A unit without shields or energy, whose maximum is 0, has neither to read.
Health and shields together, as a fraction of their combined maximum.