ProtoBot
Loading...
Searching...
No Matches
ResourceRequest Struct Reference

A ResourceRequest is a way to be able to keep an detailed decsription of what ProtoBot is wanting to make and is currently making.
A resource request goes through 4 states and changes based on the type of ResourceRequest we are dealing with.
The creation of units and upgrades is something that happenes almost instantly in StarCraft's game engine and doesnt require any other information expect the trainer that will service the ResourceRequest.
However the construction of a building is more complicated. Due to the possibility of a worker being destroyed on its way to construct a building or the tiles where a building is going to be placed is already occupied. You can compare this type of request as something that is more asynchronous.
This requires more information and fault tollerance from ProtoBot to be able to full service a ResourceRequest for buildings. More...

#include <ProtoBotCommander.h>

Public Types

enum  Type { Unit , Building , Upgrade , Tech }
enum  State { Accepted_Completed , Approved_BeingBuilt , Approved_InProgress , PendingApproval }

Public Attributes

Type type
int priority = 1
State state = PendingApproval
BWAPI::UnitType unit = BWAPI::UnitTypes::None
BWAPI::UpgradeType upgrade = BWAPI::UpgradeTypes::None
BWAPI::TechType tech = BWAPI::TechTypes::None
BWAPI::Unit scoutToPlaceBuilding = nullptr
bool isCheese = false
int frameToStartBuilding = -1
BWAPI::Unit requestedBuilding = nullptr
BWAPI::Position nexusPositionRef = BWAPI::Positions::Invalid
const BWEM::Base * base = nullptr
int frameRequestCreated = -1
int frameRequestApproved = -1
int frameRequestServiced = -1
int framesSinceLastCheck = 0
int attempts = 0
bool fromBuildOrder = false
bool isWall = false
bool isRampPlacement = false
bool gotPositionToBuild = false
BWAPI::Position placementPos = BWAPI::Positions::Invalid
BWAPI::TilePosition tileToPlace = BWAPI::TilePositions::Invalid
PlacementInfo placementInfo
size_t requestNumber = -1

Detailed Description

A ResourceRequest is a way to be able to keep an detailed decsription of what ProtoBot is wanting to make and is currently making.
A resource request goes through 4 states and changes based on the type of ResourceRequest we are dealing with.
The creation of units and upgrades is something that happenes almost instantly in StarCraft's game engine and doesnt require any other information expect the trainer that will service the ResourceRequest.
However the construction of a building is more complicated. Due to the possibility of a worker being destroyed on its way to construct a building or the tiles where a building is going to be placed is already occupied. You can compare this type of request as something that is more asynchronous.
This requires more information and fault tollerance from ProtoBot to be able to full service a ResourceRequest for buildings.

Definition at line 47 of file ProtoBotCommander.h.

Member Enumeration Documentation

◆ State

enum ResourceRequest::State

Definition at line 56 of file ProtoBotCommander.h.

56{ Accepted_Completed, Approved_BeingBuilt, Approved_InProgress, PendingApproval };

◆ Type

enum ResourceRequest::Type

Definition at line 49 of file ProtoBotCommander.h.

49{ Unit, Building, Upgrade, Tech };

Member Data Documentation

◆ attempts

int ResourceRequest::attempts = 0

Definition at line 83 of file ProtoBotCommander.h.

◆ base

const BWEM::Base* ResourceRequest::base = nullptr

Definition at line 74 of file ProtoBotCommander.h.

◆ frameRequestApproved

int ResourceRequest::frameRequestApproved = -1

Definition at line 78 of file ProtoBotCommander.h.

◆ frameRequestCreated

int ResourceRequest::frameRequestCreated = -1

Definition at line 77 of file ProtoBotCommander.h.

◆ frameRequestServiced

int ResourceRequest::frameRequestServiced = -1

Definition at line 79 of file ProtoBotCommander.h.

◆ framesSinceLastCheck

int ResourceRequest::framesSinceLastCheck = 0

Definition at line 82 of file ProtoBotCommander.h.

◆ frameToStartBuilding

int ResourceRequest::frameToStartBuilding = -1

Definition at line 67 of file ProtoBotCommander.h.

◆ fromBuildOrder

bool ResourceRequest::fromBuildOrder = false

Definition at line 86 of file ProtoBotCommander.h.

◆ gotPositionToBuild

bool ResourceRequest::gotPositionToBuild = false

Definition at line 89 of file ProtoBotCommander.h.

◆ isCheese

bool ResourceRequest::isCheese = false

Definition at line 64 of file ProtoBotCommander.h.

◆ isRampPlacement

bool ResourceRequest::isRampPlacement = false

Definition at line 88 of file ProtoBotCommander.h.

◆ isWall

bool ResourceRequest::isWall = false

Definition at line 87 of file ProtoBotCommander.h.

◆ nexusPositionRef

BWAPI::Position ResourceRequest::nexusPositionRef = BWAPI::Positions::Invalid

Definition at line 73 of file ProtoBotCommander.h.

◆ placementInfo

PlacementInfo ResourceRequest::placementInfo

Definition at line 92 of file ProtoBotCommander.h.

◆ placementPos

BWAPI::Position ResourceRequest::placementPos = BWAPI::Positions::Invalid

Definition at line 90 of file ProtoBotCommander.h.

◆ priority

int ResourceRequest::priority = 1

Definition at line 52 of file ProtoBotCommander.h.

◆ requestedBuilding

BWAPI::Unit ResourceRequest::requestedBuilding = nullptr

Definition at line 70 of file ProtoBotCommander.h.

◆ requestNumber

size_t ResourceRequest::requestNumber = -1

Definition at line 94 of file ProtoBotCommander.h.

◆ scoutToPlaceBuilding

BWAPI::Unit ResourceRequest::scoutToPlaceBuilding = nullptr

Definition at line 63 of file ProtoBotCommander.h.

◆ state

State ResourceRequest::state = PendingApproval

Definition at line 57 of file ProtoBotCommander.h.

◆ tech

BWAPI::TechType ResourceRequest::tech = BWAPI::TechTypes::None

Definition at line 61 of file ProtoBotCommander.h.

◆ tileToPlace

BWAPI::TilePosition ResourceRequest::tileToPlace = BWAPI::TilePositions::Invalid

Definition at line 91 of file ProtoBotCommander.h.

◆ type

Type ResourceRequest::type

Definition at line 50 of file ProtoBotCommander.h.

◆ unit

BWAPI::UnitType ResourceRequest::unit = BWAPI::UnitTypes::None

Definition at line 59 of file ProtoBotCommander.h.

◆ upgrade

BWAPI::UpgradeType ResourceRequest::upgrade = BWAPI::UpgradeTypes::None

Definition at line 60 of file ProtoBotCommander.h.


The documentation for this struct was generated from the following file: