|
ProtoBot
|
The ProtoBotCommander is the main way information and BWAPI events are passed to the managers of ProtoBot. The class holds no real intelligence besides passing ResourceRequests to the StrategyManager and BuildManager of ProtoBot.
The main purpose of this class is to be able to provide a easy way for information to be passed around when needed and for each manager to process events in the defined order specified in each function, updating infromation along the way.
More...
#include <ProtoBotCommander.h>
Public Member Functions | |
| void | onStart () |
| void | onFrame () |
| void | onEnd (bool isWinner) |
| void | onUnitDestroy (BWAPI::Unit unit) |
| void | onUnitMorph (BWAPI::Unit unit) |
| void | onSendText (std::string text) |
| void | onUnitCreate (BWAPI::Unit unit) |
| void | onUnitComplete (BWAPI::Unit unit) |
| void | onUnitShow (BWAPI::Unit unit) |
| void | onUnitHide (BWAPI::Unit unit) |
| void | onUnitRenegade (BWAPI::Unit unit) |
| void | drawDebugInformation () |
| void | drawBuildingCount (FriendlyBuildingCounter, int x, int y, bool background=true) |
| void | drawUnitCount (FriendlyUnitCounter, int x, int y, bool background=true) |
| void | drawUpgradeCount (FriendlyUpgradeCounter, int x, int y, bool background=true) |
| void | drawBwapiResourceInfo (int x, int y, bool background=true) |
| void | removeApprovedRequests () |
| void | requestBuilding (BWAPI::UnitType building, bool fromBuildOrder=false, bool isWall=false, bool isRampPlacement=false, BWAPI::Position nexusPosition=BWAPI::Positions::Invalid, const BWEM::Base *baseLocation=nullptr) |
| void | requestUnit (BWAPI::UnitType unit, BWAPI::Unit buildingToTrain, bool fromBuildOrder=false) |
| void | requestUpgrade (BWAPI::Unit unit, BWAPI::UpgradeType upgrade, bool fromBuildOrder=false) |
| void | requestCheese (BWAPI::UnitType, BWAPI::Unit) |
| void | drawResourceRequestQueue (int x, int y, bool background=true) |
| bool | upgradeAlreadyRequested (BWAPI::Unit building) |
| bool | requestedBuilding (BWAPI::UnitType building, BWAPI::Position nexusPosition=BWAPI::Positions::Invalid) |
| bool | checkUnitIsBeingWarpedIn (BWAPI::UnitType type, const BWEM::Base *nexus=nullptr) |
| bool | checkUnitIsPlanned (BWAPI::UnitType building, BWAPI::Position nexusPosition=BWAPI::Positions::Invalid) |
| bool | checkCheeseRequest (BWAPI::Unit) |
| bool | alreadySentRequest (int unitID) |
| BWAPI::Unit | getUnitToBuild (BWAPI::Position buildLocation) |
| std::vector< NexusEconomy > | getNexusEconomies () |
| const std::set< BWAPI::Unit > & | getKnownEnemyUnits () |
| const std::map< BWAPI::Unit, EnemyBuildingInfo > & | getKnownEnemyBuildings () |
| const EnemyLocations & | enemy () const |
| EnemyLocations & | enemy () |
| void | onEnemyMainFound (const BWAPI::TilePosition &tp) |
| void | onEnemyNaturalFound (const BWAPI::TilePosition &tp) |
| int | getEnemyGroundThreatAt (BWAPI::Position p) const |
| int | getEnemyDetectionAt (BWAPI::Position p) const |
| ThreatQueryResult | queryThreatAt (const BWAPI::Position &pos) const |
| bool | isAirThreatened (const BWAPI::Position &pos, int threshold) const |
| bool | isDetectorThreatened (const BWAPI::Position &pos) const |
| bool | buildOrderCompleted () |
| bool | checkWorkerIsConstructing (BWAPI::Unit) |
| BWAPI::Unit | getUnitToScout () |
| bool | shouldGasSteal () |
Public Attributes | |
| MapTools | m_mapTools |
| TimerManager | timerManager |
| EconomyManager | economyManager |
| ScoutingManager | scoutingManager |
| BuildManager | buildManager |
| CombatManager | combatManager |
| StrategyManager | strategyManager |
| ProtoBotRequestCounter | requestCounter |
| bool | drawUnitDebug = false |
| bool | drawBWEBDebug = false |
| bool | drawToolsDebug = false |
| int | requestCount = 0 |
| std::vector< ResourceRequest > | resourceRequests |
Private Attributes | |
| EnemyLocations | enemy_ |
The ProtoBotCommander is the main way information and BWAPI events are passed to the managers of ProtoBot. The class holds no real intelligence besides passing ResourceRequests to the StrategyManager and BuildManager of ProtoBot.
The main purpose of this class is to be able to provide a easy way for information to be passed around when needed and for each manager to process events in the defined order specified in each function, updating infromation along the way.
Definition at line 133 of file ProtoBotCommander.h.
| ProtoBotCommander::ProtoBotCommander | ( | ) |
Definition at line 4 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::alreadySentRequest | ( | int | unitID | ) |
Definition at line 641 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::buildOrderCompleted | ( | ) |
Definition at line 888 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::checkCheeseRequest | ( | BWAPI::Unit | unit | ) |
Definition at line 876 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::checkUnitIsBeingWarpedIn | ( | BWAPI::UnitType | type, |
| const BWEM::Base * | nexus = nullptr ) |
Definition at line 842 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::checkUnitIsPlanned | ( | BWAPI::UnitType | building, |
| BWAPI::Position | nexusPosition = BWAPI::Positions::Invalid ) |
Definition at line 679 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::checkWorkerIsConstructing | ( | BWAPI::Unit | unit | ) |
Definition at line 898 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawBuildingCount | ( | FriendlyBuildingCounter | ProtoBot_buildingCount, |
| int | x, | ||
| int | y, | ||
| bool | background = true ) |
Definition at line 764 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawBwapiResourceInfo | ( | int | x, |
| int | y, | ||
| bool | background = true ) |
Definition at line 796 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawDebugInformation | ( | ) |
Definition at line 808 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawResourceRequestQueue | ( | int | x, |
| int | y, | ||
| bool | background = true ) |
Definition at line 696 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawUnitCount | ( | FriendlyUnitCounter | ProtoBot_unitCount, |
| int | x, | ||
| int | y, | ||
| bool | background = true ) |
Definition at line 750 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::drawUpgradeCount | ( | FriendlyUpgradeCounter | ProtoBot_upgradeCount, |
| int | x, | ||
| int | y, | ||
| bool | background = true ) |
Definition at line 783 of file ProtoBotCommander.cpp.
|
inline |
Definition at line 202 of file ProtoBotCommander.h.
|
inline |
Definition at line 201 of file ProtoBotCommander.h.
| int ProtoBotCommander::getEnemyDetectionAt | ( | BWAPI::Position | p | ) | const |
Definition at line 1011 of file ProtoBotCommander.cpp.
| int ProtoBotCommander::getEnemyGroundThreatAt | ( | BWAPI::Position | p | ) | const |
Definition at line 1007 of file ProtoBotCommander.cpp.
| const std::map< BWAPI::Unit, EnemyBuildingInfo > & ProtoBotCommander::getKnownEnemyBuildings | ( | ) |
Definition at line 858 of file ProtoBotCommander.cpp.
| const std::set< BWAPI::Unit > & ProtoBotCommander::getKnownEnemyUnits | ( | ) |
Definition at line 853 of file ProtoBotCommander.cpp.
| std::vector< NexusEconomy > ProtoBotCommander::getNexusEconomies | ( | ) |
Definition at line 893 of file ProtoBotCommander.cpp.
| BWAPI::Unit ProtoBotCommander::getUnitToBuild | ( | BWAPI::Position | buildLocation | ) |
Definition at line 847 of file ProtoBotCommander.cpp.
| BWAPI::Unit ProtoBotCommander::getUnitToScout | ( | ) |
Definition at line 906 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::isAirThreatened | ( | const BWAPI::Position & | pos, |
| int | threshold ) const |
Definition at line 1020 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::isDetectorThreatened | ( | const BWAPI::Position & | pos | ) | const |
Definition at line 1026 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onEnd | ( | bool | isWinner | ) |
Definition at line 156 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onEnemyMainFound | ( | const BWAPI::TilePosition & | tp | ) |
Definition at line 991 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onEnemyNaturalFound | ( | const BWAPI::TilePosition & | tp | ) |
Definition at line 999 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onFrame | ( | ) |
Definition at line 76 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onSendText | ( | std::string | text | ) |
Definition at line 222 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onStart | ( | ) |
Definition at line 12 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitComplete | ( | BWAPI::Unit | unit | ) |
Definition at line 381 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitCreate | ( | BWAPI::Unit | unit | ) |
Definition at line 294 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitDestroy | ( | BWAPI::Unit | unit | ) |
Definition at line 167 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitHide | ( | BWAPI::Unit | unit | ) |
Definition at line 433 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitMorph | ( | BWAPI::Unit | unit | ) |
Definition at line 180 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitRenegade | ( | BWAPI::Unit | unit | ) |
Definition at line 438 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::onUnitShow | ( | BWAPI::Unit | unit | ) |
Definition at line 428 of file ProtoBotCommander.cpp.
| ThreatQueryResult ProtoBotCommander::queryThreatAt | ( | const BWAPI::Position & | pos | ) | const |
Definition at line 1015 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::removeApprovedRequests | ( | ) |
Definition at line 443 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::requestBuilding | ( | BWAPI::UnitType | building, |
| bool | fromBuildOrder = false, | ||
| bool | isWall = false, | ||
| bool | isRampPlacement = false, | ||
| BWAPI::Position | nexusPosition = BWAPI::Positions::Invalid, | ||
| const BWEM::Base * | baseLocation = nullptr ) |
Definition at line 527 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::requestCheese | ( | BWAPI::UnitType | building, |
| BWAPI::Unit | unit ) |
Definition at line 864 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::requestedBuilding | ( | BWAPI::UnitType | building, |
| BWAPI::Position | nexusPosition = BWAPI::Positions::Invalid ) |
Definition at line 653 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::requestUnit | ( | BWAPI::UnitType | unit, |
| BWAPI::Unit | buildingToTrain, | ||
| bool | fromBuildOrder = false ) |
Definition at line 577 of file ProtoBotCommander.cpp.
| void ProtoBotCommander::requestUpgrade | ( | BWAPI::Unit | unit, |
| BWAPI::UpgradeType | upgrade, | ||
| bool | fromBuildOrder = false ) |
Definition at line 609 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::shouldGasSteal | ( | ) |
Definition at line 1032 of file ProtoBotCommander.cpp.
| bool ProtoBotCommander::upgradeAlreadyRequested | ( | BWAPI::Unit | building | ) |
Definition at line 667 of file ProtoBotCommander.cpp.
| BuildManager ProtoBotCommander::buildManager |
Definition at line 141 of file ProtoBotCommander.h.
| CombatManager ProtoBotCommander::combatManager |
Definition at line 142 of file ProtoBotCommander.h.
| bool ProtoBotCommander::drawBWEBDebug = false |
Definition at line 148 of file ProtoBotCommander.h.
| bool ProtoBotCommander::drawToolsDebug = false |
Definition at line 149 of file ProtoBotCommander.h.
| bool ProtoBotCommander::drawUnitDebug = false |
Definition at line 147 of file ProtoBotCommander.h.
| EconomyManager ProtoBotCommander::economyManager |
Definition at line 139 of file ProtoBotCommander.h.
|
private |
Definition at line 222 of file ProtoBotCommander.h.
| MapTools ProtoBotCommander::m_mapTools |
Definition at line 137 of file ProtoBotCommander.h.
| int ProtoBotCommander::requestCount = 0 |
Definition at line 151 of file ProtoBotCommander.h.
| ProtoBotRequestCounter ProtoBotCommander::requestCounter |
Definition at line 144 of file ProtoBotCommander.h.
| std::vector<ResourceRequest> ProtoBotCommander::resourceRequests |
Definition at line 153 of file ProtoBotCommander.h.
| ScoutingManager ProtoBotCommander::scoutingManager |
Definition at line 140 of file ProtoBotCommander.h.
| StrategyManager ProtoBotCommander::strategyManager |
Definition at line 143 of file ProtoBotCommander.h.
| TimerManager ProtoBotCommander::timerManager |
Definition at line 138 of file ProtoBotCommander.h.