13 #include <torchcraft/client.h> 41 double mineralCost = 0.0;
59 bool isWorker =
false;
65 double supplyProvided = 0.0;
72 double supplyRequired = 0.0;
73 bool isTwoUnitsInOneEgg =
false;
74 bool isRefinery =
false;
75 bool isMinerals =
false;
77 bool requiresPsi =
false;
78 bool requiresCreep =
false;
79 bool isBuilding =
false;
80 bool isResourceDepot =
false;
81 bool isResourceContainer =
false;
82 bool isSpecialBuilding =
false;
83 int dimensionLeft = 0;
85 int dimensionRight = 0;
86 int dimensionDown = 0;
89 bool hasAirWeapon =
false;
90 bool hasGroundWeapon =
false;
91 int numAirAttacks = 0;
92 int numGroundAttacks = 0;
93 bool canProduce =
false;
94 bool canBuildAddon =
false;
96 bool isDetector =
false;
99 bool isNonUsable =
false;
101 double subjectiveValue = 0;
105 int airWeaponCooldown = 0;
106 int groundWeaponCooldown = 0;
108 bool isBiological =
false;
109 bool producesCreep =
false;
110 bool producesLarva =
false;
111 bool restrictedByDarkSwarm =
false;
117 return upgrade != -1;
137 const BuildType* getBuildType(BWAPI::TechType type);
139 const BuildType* getBuildType(BWAPI::UpgradeType type,
int level = 1);
142 namespace buildtypes {
385 case torchcraft::BW::Race::Protoss:
386 return buildtypes::Protoss_Probe;
387 case torchcraft::BW::Race::Zerg:
388 return buildtypes::Zerg_Drone;
390 return buildtypes::Terran_SCV;
395 case torchcraft::BW::Race::Protoss:
396 return buildtypes::Protoss_Assimilator;
397 case torchcraft::BW::Race::Zerg:
398 return buildtypes::Zerg_Extractor;
400 return buildtypes::Terran_Refinery;
405 case torchcraft::BW::Race::Protoss:
406 return buildtypes::Protoss_Pylon;
407 case torchcraft::BW::Race::Zerg:
408 return buildtypes::Zerg_Overlord;
410 return buildtypes::Terran_Supply_Depot;
415 case torchcraft::BW::Race::Protoss:
416 return buildtypes::Protoss_Nexus;
417 case torchcraft::BW::Race::Zerg:
418 return buildtypes::Zerg_Hatchery;
420 return buildtypes::Terran_Command_Center;
const BuildType * Zerg_Lurker
Definition: buildtype.cpp:323
const BuildType * Zerg_Missile_Attacks_2
Definition: buildtype.cpp:418
bool isUpgrade() const
Definition: buildtype.h:116
const BuildType * Protoss_Shield_Battery
Definition: buildtype.cpp:375
const BuildType * Terran_Machine_Shop
Definition: buildtype.cpp:338
const BuildType * Zerg_Drone
Definition: buildtype.cpp:289
const BuildType * Zerg_Infested_Terran
Definition: buildtype.cpp:296
const BuildType * Protoss_Air_Armor_2
Definition: buildtype.cpp:403
const BuildType * Terran_Vehicle_Weapons_2
Definition: buildtype.cpp:409
const BuildType * Zerg_Cocoon
Definition: buildtype.cpp:298
const BuildType * Critter_Bengalaas
Definition: buildtype.cpp:317
const BuildType * Muscular_Augments
Definition: buildtype.cpp:444
const BuildType * Critter_Kakaru
Definition: buildtype.cpp:319
const BuildType * Terran_Marine
Definition: buildtype.cpp:266
const BuildType * Protoss_Reaver
Definition: buildtype.cpp:313
const BuildType * Protoss_Shuttle
Definition: buildtype.cpp:308
const BuildType * Caduceus_Reactor
Definition: buildtype.cpp:462
const BuildType * Zerg_Flyer_Carapace_2
Definition: buildtype.cpp:397
const BuildType * Zerg_Defiler
Definition: buildtype.cpp:294
const BuildType * Charon_Boosters
Definition: buildtype.cpp:465
const BuildType * Recall
Definition: buildtype.cpp:487
const BuildType * Terran_Infantry_Weapons_1
Definition: buildtype.cpp:405
const BuildType * Zerg_Ultralisk_Cavern
Definition: buildtype.cpp:353
const BuildType * Zerg_Overlord
Definition: buildtype.cpp:290
const BuildType * Restoration
Definition: buildtype.cpp:490
bool isTerran() const
Definition: buildtype.h:122
const BuildType * Terran_Vehicle_Plating_2
Definition: buildtype.cpp:388
const BuildType * Special_Right_Pit_Door
Definition: buildtype.cpp:382
const BuildType * Protoss_Dragoon
Definition: buildtype.cpp:305
const BuildType * Protoss_Interceptor
Definition: buildtype.cpp:312
const BuildType * Yamato_Gun
Definition: buildtype.cpp:474
const BuildType * Terran_Ghost
Definition: buildtype.cpp:267
const BuildType * Gravitic_Drive
Definition: buildtype.cpp:452
const BuildType * Critter_Ursadon
Definition: buildtype.cpp:321
const BuildType * Zerg_Spawning_Pool
Definition: buildtype.cpp:355
const BuildType * Reaver_Capacity
Definition: buildtype.cpp:451
const BuildType * Moebius_Reactor
Definition: buildtype.cpp:436
const BuildType * Terran_Infantry_Weapons_3
Definition: buildtype.cpp:407
const BuildType * getUnitBuildType(int unit)
Definition: buildtype.cpp:180
const BuildType * Irradiate
Definition: buildtype.cpp:473
Represents and holds information about buildable types (units, upgrades, techs).
Definition: buildtype.h:36
const BuildType * Dark_Swarm
Definition: buildtype.cpp:480
const BuildType * Zerg_Larva
Definition: buildtype.cpp:283
const BuildType * Zerg_Flyer_Carapace_3
Definition: buildtype.cpp:398
const BuildType * Protoss_High_Templar
Definition: buildtype.cpp:306
const BuildType * Terran_Nuclear_Missile
Definition: buildtype.cpp:277
const BuildType * Special_Pit_Door
Definition: buildtype.cpp:381
const BuildType * Stasis_Field
Definition: buildtype.cpp:488
const BuildType * Terran_Infantry_Armor_1
Definition: buildtype.cpp:384
const BuildType * Protoss_Gateway
Definition: buildtype.cpp:365
const BuildType * Protoss_Templar_Archives
Definition: buildtype.cpp:369
const BuildType * Protoss_Ground_Weapons_2
Definition: buildtype.cpp:424
const BuildType * Terran_Armory
Definition: buildtype.cpp:340
const BuildType * Terran_Goliath
Definition: buildtype.cpp:269
BuildType()
Definition: buildtype.h:132
std::vector< const BuildType * > whatUses
Definition: buildtype.h:47
const BuildType * Terran_SCV
Definition: buildtype.cpp:271
const BuildType * Protoss_Pylon
Definition: buildtype.cpp:362
const BuildType * getRaceRefinery(int race)
Definition: buildtype.h:393
const BuildType * Terran_Siege_Tank_Tank_Mode
Definition: buildtype.cpp:270
const BuildType * Antennae
Definition: buildtype.cpp:440
const BuildType * Protoss_Scarab
Definition: buildtype.cpp:315
const BuildType * Hallucination
Definition: buildtype.cpp:486
const BuildType * Terran_Civilian
Definition: buildtype.cpp:278
const BuildType * Tank_Siege_Mode
Definition: buildtype.cpp:471
const BuildType * Protoss_Fleet_Beacon
Definition: buildtype.cpp:372
const BuildType * Zerg_Hive
Definition: buildtype.cpp:346
const BuildType * Dark_Archon_Meld
Definition: buildtype.cpp:493
const BuildType * Zerg_Carapace_2
Definition: buildtype.cpp:394
const BuildType * Terran_Engineering_Bay
Definition: buildtype.cpp:339
const BuildType * Terran_Medic
Definition: buildtype.cpp:282
const BuildType * Scarab_Damage
Definition: buildtype.cpp:450
const BuildType * Protoss_Corsair
Definition: buildtype.cpp:299
const BuildType * Zerg_Flyer_Attacks_2
Definition: buildtype.cpp:421
const BuildType * Feedback
Definition: buildtype.cpp:494
const BuildType * Zerg_Missile_Attacks_3
Definition: buildtype.cpp:419
const BuildType * Spider_Mines
Definition: buildtype.cpp:469
const BuildType * U_238_Shells
Definition: buildtype.cpp:432
const BuildType * Apial_Sensors
Definition: buildtype.cpp:456
const BuildType * Zerg_Missile_Attacks_1
Definition: buildtype.cpp:417
const BuildType * Lurker_Aspect
Definition: buildtype.cpp:497
const BuildType * Zerg_Melee_Attacks_3
Definition: buildtype.cpp:416
const BuildType * Zerg_Ultralisk
Definition: buildtype.cpp:287
const BuildType * Critter_Scantid
Definition: buildtype.cpp:318
const BuildType * Terran_Factory
Definition: buildtype.cpp:332
const BuildType * Zerg_Flyer_Attacks_3
Definition: buildtype.cpp:422
const BuildType * Defensive_Matrix
Definition: buildtype.cpp:472
const BuildType * Zerg_Nydus_Canal
Definition: buildtype.cpp:347
const BuildType * Sensor_Array
Definition: buildtype.cpp:453
void initialize()
Definition: buildtype.cpp:500
bool isTech() const
Definition: buildtype.h:119
const BuildType * getRaceSupplyDepot(int race)
Definition: buildtype.h:403
const BuildType * Zerg_Carapace_1
Definition: buildtype.cpp:393
const BuildType * Zerg_Greater_Spire
Definition: buildtype.cpp:350
const BuildType * Grooved_Spines
Definition: buildtype.cpp:445
const BuildType * Terran_Science_Facility
Definition: buildtype.cpp:335
const BuildType * Ion_Thrusters
Definition: buildtype.cpp:433
const BuildType * Terran_Starport
Definition: buildtype.cpp:333
const BuildType * Protoss_Ground_Armor_3
Definition: buildtype.cpp:401
const BuildType * Critter_Rhynadon
Definition: buildtype.cpp:316
const BuildType * Protoss_Observatory
Definition: buildtype.cpp:364
const BuildType * Terran_Bunker
Definition: buildtype.cpp:342
std::vector< const BuildType * > allUnitTypes
Definition: buildtype.cpp:32
const BuildType * Terran_Physics_Lab
Definition: buildtype.cpp:337
const BuildType * Zerg_Hydralisk
Definition: buildtype.cpp:286
const BuildType * Zerg_Hydralisk_Den
Definition: buildtype.cpp:348
const BuildType * Consume
Definition: buildtype.cpp:482
std::vector< const BuildType * > allTechTypes
Definition: buildtype.cpp:34
std::string name
Definition: buildtype.h:44
const BuildType * Scanner_Sweep
Definition: buildtype.cpp:470
bool isProtoss() const
Definition: buildtype.h:125
const BuildType * Terran_Valkyrie
Definition: buildtype.cpp:297
const BuildType * Protoss_Carrier
Definition: buildtype.cpp:311
const BuildType * Terran_Control_Tower
Definition: buildtype.cpp:334
const BuildType * Spell_Disruption_Web
Definition: buildtype.cpp:324
const BuildType * Terran_Infantry_Armor_3
Definition: buildtype.cpp:386
const BuildType * Zerg_Flyer_Carapace_1
Definition: buildtype.cpp:396
const BuildType * Terran_Supply_Depot
Definition: buildtype.cpp:328
const BuildType * Protoss_Probe
Definition: buildtype.cpp:303
const BuildType * Protoss_Air_Armor_1
Definition: buildtype.cpp:402
const BuildType * Protoss_Robotics_Support_Bay
Definition: buildtype.cpp:374
const BuildType * Maelstrom
Definition: buildtype.cpp:496
const BuildType * Resource_Mineral_Field
Definition: buildtype.cpp:376
const BuildType * Terran_Battlecruiser
Definition: buildtype.cpp:275
const BuildType * Colossus_Reactor
Definition: buildtype.cpp:438
const BuildType * Resource_Mineral_Field_Type_2
Definition: buildtype.cpp:377
const BuildType * Terran_Wraith
Definition: buildtype.cpp:272
const BuildType * EMP_Shockwave
Definition: buildtype.cpp:468
const BuildType * Terran_Command_Center
Definition: buildtype.cpp:325
const BuildType * Protoss_Scout
Definition: buildtype.cpp:309
const BuildType * Protoss_Ground_Armor_2
Definition: buildtype.cpp:400
const BuildType * getUpgradeBuildType(int upgrade, int level)
Definition: buildtype.cpp:260
const BuildType * Zerg_Sunken_Colony
Definition: buildtype.cpp:358
const BuildType * Gamete_Meiosis
Definition: buildtype.cpp:446
const BuildType * Terran_Comsat_Station
Definition: buildtype.cpp:326
const BuildType * Zerg_Melee_Attacks_2
Definition: buildtype.cpp:415
const BuildType * Zerg_Flyer_Attacks_1
Definition: buildtype.cpp:420
const BuildType * Terran_Refinery
Definition: buildtype.cpp:329
const BuildType * Zerg_Zergling
Definition: buildtype.cpp:285
const BuildType * Terran_Ship_Plating_2
Definition: buildtype.cpp:391
const BuildType * Protoss_Zealot
Definition: buildtype.cpp:304
const BuildType * Protoss_Forge
Definition: buildtype.cpp:370
const BuildType * Zerg_Spire
Definition: buildtype.cpp:354
const BuildType * Ventral_Sacs
Definition: buildtype.cpp:439
const BuildType * Zerg_Creep_Colony
Definition: buildtype.cpp:356
const BuildType * Protoss_Ground_Weapons_3
Definition: buildtype.cpp:425
const BuildType * Personnel_Cloaking
Definition: buildtype.cpp:476
Definition: buildtype.h:15
const BuildType * Protoss_Assimilator
Definition: buildtype.cpp:363
const BuildType * Terran_Vehicle_Weapons_1
Definition: buildtype.cpp:408
const BuildType * Terran_Academy
Definition: buildtype.cpp:331
const BuildType * Spell_Scanner_Sweep
Definition: buildtype.cpp:281
const BuildType * Burrowing
Definition: buildtype.cpp:477
const BuildType * Resource_Vespene_Geyser
Definition: buildtype.cpp:379
const BuildType * Pneumatized_Carapace
Definition: buildtype.cpp:441
const BuildType * Terran_Barracks
Definition: buildtype.cpp:330
const BuildType * Psionic_Storm
Definition: buildtype.cpp:485
const BuildType * Zerg_Guardian
Definition: buildtype.cpp:292
const BuildType * Spawn_Broodlings
Definition: buildtype.cpp:479
const BuildType * Khaydarin_Amulet
Definition: buildtype.cpp:455
const BuildType * Optical_Flare
Definition: buildtype.cpp:495
const BuildType * Cloaking_Field
Definition: buildtype.cpp:475
const BuildType * Infestation
Definition: buildtype.cpp:478
const BuildType * Terran_Missile_Turret
Definition: buildtype.cpp:341
const BuildType * Terran_Covert_Ops
Definition: buildtype.cpp:336
const BuildType * Metabolic_Boost
Definition: buildtype.cpp:442
const BuildType * Zerg_Spore_Colony
Definition: buildtype.cpp:357
const BuildType * Zerg_Lurker_Egg
Definition: buildtype.cpp:322
const BuildType * Singularity_Charge
Definition: buildtype.cpp:448
const BuildType * Zerg_Egg
Definition: buildtype.cpp:284
const BuildType * Argus_Jewel
Definition: buildtype.cpp:460
const BuildType * Zerg_Lair
Definition: buildtype.cpp:345
const BuildType * Protoss_Ground_Armor_1
Definition: buildtype.cpp:399
const BuildType * Ocular_Implants
Definition: buildtype.cpp:435
const BuildType * Protoss_Stargate
Definition: buildtype.cpp:371
const BuildType * Gravitic_Thrusters
Definition: buildtype.cpp:457
const BuildType * Disruption_Web
Definition: buildtype.cpp:491
const BuildType * Protoss_Arbiter
Definition: buildtype.cpp:310
const BuildType * Protoss_Ground_Weapons_1
Definition: buildtype.cpp:423
const BuildType * Protoss_Dark_Archon
Definition: buildtype.cpp:302
const BuildType * Protoss_Air_Weapons_3
Definition: buildtype.cpp:428
const BuildType * Terran_Ship_Weapons_3
Definition: buildtype.cpp:413
const BuildType * Protoss_Plasma_Shields_2
Definition: buildtype.cpp:430
const BuildType * Anabolic_Synthesis
Definition: buildtype.cpp:464
const BuildType * Zerg_Scourge
Definition: buildtype.cpp:295
const BuildType * getRaceCommandCenter(int race)
Definition: buildtype.h:413
const BuildType * Terran_Vulture
Definition: buildtype.cpp:268
std::vector< const BuildType * > prerequisites
Definition: buildtype.h:43
const BuildType * Terran_Vehicle_Weapons_3
Definition: buildtype.cpp:410
const BuildType * Spell_Dark_Swarm
Definition: buildtype.cpp:380
const BuildType * Resource_Mineral_Field_Type_3
Definition: buildtype.cpp:378
const BuildType * Terran_Firebat
Definition: buildtype.cpp:280
const BuildType * Stim_Packs
Definition: buildtype.cpp:466
const BuildType * Apollo_Reactor
Definition: buildtype.cpp:437
const BuildType * Protoss_Photon_Cannon
Definition: buildtype.cpp:366
const BuildType * Khaydarin_Core
Definition: buildtype.cpp:459
const BuildType * Adrenal_Glands
Definition: buildtype.cpp:443
const BuildType * Terran_Vehicle_Plating_3
Definition: buildtype.cpp:389
const BuildType * Protoss_Air_Armor_3
Definition: buildtype.cpp:404
const BuildType * Terran_Ship_Plating_3
Definition: buildtype.cpp:392
const BuildType * Protoss_Cybernetics_Core
Definition: buildtype.cpp:368
const BuildType * Zerg_Broodling
Definition: buildtype.cpp:288
const BuildType * Protoss_Air_Weapons_1
Definition: buildtype.cpp:426
const BuildType * Archon_Warp
Definition: buildtype.cpp:489
const BuildType * Carrier_Capacity
Definition: buildtype.cpp:458
const BuildType * Protoss_Plasma_Shields_1
Definition: buildtype.cpp:429
const BuildType * Ensnare
Definition: buildtype.cpp:483
const BuildType * Protoss_Dark_Templar
Definition: buildtype.cpp:300
const BuildType * Mind_Control
Definition: buildtype.cpp:492
Main namespace for bot-related code.
Definition: areainfo.cpp:17
const BuildType * Protoss_Citadel_of_Adun
Definition: buildtype.cpp:367
const BuildType * Terran_Ship_Plating_1
Definition: buildtype.cpp:390
const BuildType * Argus_Talisman
Definition: buildtype.cpp:461
const BuildType * Protoss_Plasma_Shields_3
Definition: buildtype.cpp:431
const BuildType * Zerg_Evolution_Chamber
Definition: buildtype.cpp:352
const BuildType * Zerg_Infested_Command_Center
Definition: buildtype.cpp:343
const BuildType * getRaceWorker(int race)
Definition: buildtype.h:383
const BuildType * Terran_Dropship
Definition: buildtype.cpp:274
const BuildType * Protoss_Observer
Definition: buildtype.cpp:314
const BuildType * Leg_Enhancements
Definition: buildtype.cpp:449
const BuildType * Zerg_Extractor
Definition: buildtype.cpp:359
const BuildType * Chitinous_Plating
Definition: buildtype.cpp:463
const BuildType * Healing
Definition: buildtype.cpp:498
const BuildType * Critter_Ragnasaur
Definition: buildtype.cpp:320
const BuildType * Terran_Vehicle_Plating_1
Definition: buildtype.cpp:387
const BuildType * Terran_Infantry_Armor_2
Definition: buildtype.cpp:385
bool isUnit() const
Definition: buildtype.h:113
const BuildType * Terran_Science_Vessel
Definition: buildtype.cpp:273
bool isZerg() const
Definition: buildtype.h:128
std::vector< const BuildType * > allUpgradeTypes
Definition: buildtype.cpp:33
const BuildType * Protoss_Archon
Definition: buildtype.cpp:307
const BuildType * Terran_Siege_Tank_Siege_Mode
Definition: buildtype.cpp:279
const BuildType * Terran_Nuclear_Silo
Definition: buildtype.cpp:327
const BuildType * Protoss_Air_Weapons_2
Definition: buildtype.cpp:427
const BuildType * getTechBuildType(int tech)
Definition: buildtype.cpp:214
const BuildType * Terran_Infantry_Weapons_2
Definition: buildtype.cpp:406
const BuildType * getBuildType(BWAPI::UnitType type)
Definition: buildtype.cpp:53
const BuildType * Zerg_Defiler_Mound
Definition: buildtype.cpp:349
const BuildType * Titan_Reactor
Definition: buildtype.cpp:434
const BuildType * Protoss_Nexus
Definition: buildtype.cpp:360
const BuildType * Terran_Ship_Weapons_1
Definition: buildtype.cpp:411
const BuildType * Zerg_Devourer
Definition: buildtype.cpp:301
const BuildType * Zerg_Carapace_3
Definition: buildtype.cpp:395
const BuildType * Zerg_Melee_Attacks_1
Definition: buildtype.cpp:414
const BuildType * Protoss_Arbiter_Tribunal
Definition: buildtype.cpp:373
const BuildType * Protoss_Robotics_Facility
Definition: buildtype.cpp:361
const BuildType * Plague
Definition: buildtype.cpp:481
const BuildType * Zerg_Queens_Nest
Definition: buildtype.cpp:351
const BuildType * Gravitic_Boosters
Definition: buildtype.cpp:454
const BuildType * Zerg_Mutalisk
Definition: buildtype.cpp:291
const BuildType * Lockdown
Definition: buildtype.cpp:467
const BuildType * Zerg_Queen
Definition: buildtype.cpp:293
const BuildType * Terran_Vulture_Spider_Mine
Definition: buildtype.cpp:276
const BuildType * Parasite
Definition: buildtype.cpp:484
const BuildType * Terran_Ship_Weapons_2
Definition: buildtype.cpp:412
const BuildType * Metasynaptic_Node
Definition: buildtype.cpp:447
const BuildType * Zerg_Hatchery
Definition: buildtype.cpp:344