TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Classes | Typedefs | Functions | Variables
cherrypi::autobuild Namespace Reference

Classes

struct  BuildEntry
 
struct  BuildState
 Describes a state of the game, either now or in a hypothetical future, for use in AutoBuilds. More...
 
struct  BuildStateUnit
 

Typedefs

using BuildTypeId = uint32_t
 

Functions

std::string buildLogIndent ()
 
bool hasUnit (const BuildState &st, const BuildType *type)
 Returns true if we have this unit in this BuildState. More...
 
bool hasUpgrade (const BuildState &st, const BuildType *type)
 Returns true if we have this upgrade in this BuildState. More...
 
bool hasTech (const BuildState &st, const BuildType *type)
 Returns true if we have this tech in this BuildState. More...
 
bool has (const BuildState &st, const BuildType *type)
 Returns true if we have any of this BuildType completed in this BuildState. More...
 
int countUnits (const BuildState &st, const BuildType *type)
 Returns the number of completed units of this BuildType in this BuildState. More...
 
bool isInProduction (const BuildState &st, const BuildType *type)
 Returns true if we are currently producing this BuildType in this BuildState. More...
 
bool hasOrInProduction (const BuildState &st, const BuildType *type)
 Returns true if we have this BuildType in this BuildState, either complete or in production. More...
 
int framesUntil (const BuildState &st, const BuildType *type)
 Returns how many frames before a type will be available Defaults to kForever if the type isn't complete or enqueued. More...
 
int countProduction (const BuildState &st, const BuildType *type)
 Returns the number of this BuildType in production in this BuildState. More...
 
int countPlusProduction (const BuildState &st, const BuildType *type)
 Returns the number of this BuildType this BuildState, either complete or in production. More...
 
int larvaCount (const BuildState &st, const BuildStateUnit &)
 Returns the number of Larva at this Hatchery/Lair/Hive in this BuildState. More...
 
BuildStateUnitaddUnit (BuildState &st, const BuildType *type)
 
void removeUnit (BuildState &st, BuildStateUnit &u)
 
template<typename list_T , typename T >
void emplaceProd (list_T &list, int frame, T t)
 
BuildState getMyState (State *state)
 
const BuildTypeadvance (BuildState &st, BuildEntry thing, int endFrame)
 
bool depbuild (BuildState &st, const BuildState &prevSt, BuildEntry thing)
 
template<typename F >
bool nodelayStage2 (BuildState &st, BuildState thingSt, BuildEntry thing, F &&otherThing)
 
template<typename F >
bool nodelay (BuildState &st, BuildEntry thing, F &&otherThing)
 
BuildTypeId buildTypeId (cherrypi::BuildType const *type)
 
cherrypi::BuildType const * buildTypeFromId (BuildTypeId id)
 
template<class Archive >
void save (Archive &ar, BuildStateUnit const &stu)
 
template<class Archive >
void load (Archive &ar, BuildStateUnit &stu)
 
template<class Archive >
void save (Archive &ar, BuildEntry const &e)
 
template<class Archive >
void load (Archive &ar, BuildEntry &e)
 
template<class Archive >
void save (Archive &ar, BuildState const &st)
 
template<class Archive >
void load (Archive &ar, BuildState &st)
 
template void save< cereal::BinaryOutputArchive > (cereal::BinaryOutputArchive &archive, BuildStateUnit const &stu)
 
template void load< cereal::BinaryInputArchive > (cereal::BinaryInputArchive &archive, BuildStateUnit &stu)
 
template void save< cereal::BinaryOutputArchive > (cereal::BinaryOutputArchive &archive, BuildEntry const &e)
 
template void load< cereal::BinaryInputArchive > (cereal::BinaryInputArchive &archive, BuildEntry &e)
 
template void save< cereal::BinaryOutputArchive > (cereal::BinaryOutputArchive &archive, BuildState const &stu)
 
template void load< cereal::BinaryInputArchive > (cereal::BinaryInputArchive &archive, BuildState &stu)
 
template void save< cereal::JSONOutputArchive > (cereal::JSONOutputArchive &archive, BuildStateUnit const &stu)
 
template void load< cereal::JSONInputArchive > (cereal::JSONInputArchive &archive, BuildStateUnit &stu)
 
template void save< cereal::JSONOutputArchive > (cereal::JSONOutputArchive &archive, BuildEntry const &e)
 
template void load< cereal::JSONInputArchive > (cereal::JSONInputArchive &archive, BuildEntry &e)
 
template void save< cereal::JSONOutputArchive > (cereal::JSONOutputArchive &archive, BuildState const &stu)
 
template void load< cereal::JSONInputArchive > (cereal::JSONInputArchive &archive, BuildState &stu)
 

Variables

thread_local int buildLogDepth = 0
 
const BuildType failedObject
 
const BuildTypefailed = &failedObject
 
const BuildType timeoutObject
 
const BuildTypetimeout = &timeoutObject
 
const BuildType builtdepObject
 
const BuildTypebuiltdep = &builtdepObject
 

Typedef Documentation

using cherrypi::autobuild::BuildTypeId = typedef uint32_t

Function Documentation

BuildStateUnit& cherrypi::autobuild::addUnit ( BuildState st,
const BuildType type 
)
const BuildType* cherrypi::autobuild::advance ( BuildState st,
BuildEntry  thing,
int  endFrame 
)
std::string cherrypi::autobuild::buildLogIndent ( )
cherrypi::BuildType const* cherrypi::autobuild::buildTypeFromId ( BuildTypeId  id)
inline
BuildTypeId cherrypi::autobuild::buildTypeId ( cherrypi::BuildType const *  type)
inline
int cherrypi::autobuild::countPlusProduction ( const BuildState st,
const BuildType type 
)

Returns the number of this BuildType this BuildState, either complete or in production.

int cherrypi::autobuild::countProduction ( const BuildState st,
const BuildType type 
)

Returns the number of this BuildType in production in this BuildState.

int cherrypi::autobuild::countUnits ( const BuildState st,
const BuildType type 
)

Returns the number of completed units of this BuildType in this BuildState.

bool cherrypi::autobuild::depbuild ( BuildState st,
const BuildState prevSt,
BuildEntry  thing 
)
template<typename list_T , typename T >
void cherrypi::autobuild::emplaceProd ( list_T &  list,
int  frame,
t 
)
int cherrypi::autobuild::framesUntil ( const BuildState st,
const BuildType type 
)

Returns how many frames before a type will be available Defaults to kForever if the type isn't complete or enqueued.

BuildState cherrypi::autobuild::getMyState ( State state)
bool cherrypi::autobuild::has ( const BuildState st,
const BuildType type 
)

Returns true if we have any of this BuildType completed in this BuildState.

bool cherrypi::autobuild::hasOrInProduction ( const BuildState st,
const BuildType type 
)

Returns true if we have this BuildType in this BuildState, either complete or in production.

bool cherrypi::autobuild::hasTech ( const BuildState st,
const BuildType type 
)

Returns true if we have this tech in this BuildState.

bool cherrypi::autobuild::hasUnit ( const BuildState st,
const BuildType type 
)

Returns true if we have this unit in this BuildState.

bool cherrypi::autobuild::hasUpgrade ( const BuildState st,
const BuildType type 
)

Returns true if we have this upgrade in this BuildState.

bool cherrypi::autobuild::isInProduction ( const BuildState st,
const BuildType type 
)

Returns true if we are currently producing this BuildType in this BuildState.

int cherrypi::autobuild::larvaCount ( const autobuild::BuildState st,
const autobuild::BuildStateUnit u 
)

Returns the number of Larva at this Hatchery/Lair/Hive in this BuildState.

template<class Archive >
void cherrypi::autobuild::load ( Archive &  ar,
BuildStateUnit stu 
)
template<class Archive >
void cherrypi::autobuild::load ( Archive &  ar,
BuildEntry e 
)
template<class Archive >
void cherrypi::autobuild::load ( Archive &  ar,
BuildState st 
)
template void cherrypi::autobuild::load< cereal::BinaryInputArchive > ( cereal::BinaryInputArchive &  archive,
BuildStateUnit stu 
)
template void cherrypi::autobuild::load< cereal::BinaryInputArchive > ( cereal::BinaryInputArchive &  archive,
BuildEntry e 
)
template void cherrypi::autobuild::load< cereal::BinaryInputArchive > ( cereal::BinaryInputArchive &  archive,
BuildState stu 
)
template void cherrypi::autobuild::load< cereal::JSONInputArchive > ( cereal::JSONInputArchive &  archive,
BuildStateUnit stu 
)
template void cherrypi::autobuild::load< cereal::JSONInputArchive > ( cereal::JSONInputArchive &  archive,
BuildEntry e 
)
template void cherrypi::autobuild::load< cereal::JSONInputArchive > ( cereal::JSONInputArchive &  archive,
BuildState stu 
)
template<typename F >
bool cherrypi::autobuild::nodelay ( BuildState st,
BuildEntry  thing,
F &&  otherThing 
)
template<typename F >
bool cherrypi::autobuild::nodelayStage2 ( BuildState st,
BuildState  thingSt,
BuildEntry  thing,
F &&  otherThing 
)
void cherrypi::autobuild::removeUnit ( BuildState st,
BuildStateUnit u 
)
template<class Archive >
void cherrypi::autobuild::save ( Archive &  ar,
BuildStateUnit const &  stu 
)
template<class Archive >
void cherrypi::autobuild::save ( Archive &  ar,
BuildEntry const &  e 
)
template<class Archive >
void cherrypi::autobuild::save ( Archive &  ar,
BuildState const &  st 
)
template void cherrypi::autobuild::save< cereal::BinaryOutputArchive > ( cereal::BinaryOutputArchive &  archive,
BuildStateUnit const &  stu 
)
template void cherrypi::autobuild::save< cereal::BinaryOutputArchive > ( cereal::BinaryOutputArchive &  archive,
BuildEntry const &  e 
)
template void cherrypi::autobuild::save< cereal::BinaryOutputArchive > ( cereal::BinaryOutputArchive &  archive,
BuildState const &  stu 
)
template void cherrypi::autobuild::save< cereal::JSONOutputArchive > ( cereal::JSONOutputArchive &  archive,
BuildStateUnit const &  stu 
)
template void cherrypi::autobuild::save< cereal::JSONOutputArchive > ( cereal::JSONOutputArchive &  archive,
BuildEntry const &  e 
)
template void cherrypi::autobuild::save< cereal::JSONOutputArchive > ( cereal::JSONOutputArchive &  archive,
BuildState const &  stu 
)

Variable Documentation

thread_local int cherrypi::autobuild::buildLogDepth = 0
const BuildType* cherrypi::autobuild::builtdep = &builtdepObject
const BuildType cherrypi::autobuild::builtdepObject
const BuildType* cherrypi::autobuild::failed = &failedObject
const BuildType cherrypi::autobuild::failedObject
const BuildType* cherrypi::autobuild::timeout = &timeoutObject
const BuildType cherrypi::autobuild::timeoutObject