The main bot object.
More...
#include <baseplayer.h>
Inherited by cherrypi::MicroPlayer, and cherrypi::Player.
The main bot object.
This class is used to play StarCraft Broodwar (TM) via the TorchCraft bridge. The behavior and actions of the player are determined by a user-supplied list of bot modules.
cherrypi::BasePlayer::BasePlayer |
( |
std::shared_ptr< tc::Client > |
client | ) |
|
cherrypi::BasePlayer::~BasePlayer |
( |
| ) |
|
|
virtual |
cherrypi::BasePlayer::BasePlayer |
( |
const BasePlayer & |
| ) |
|
|
delete |
void cherrypi::BasePlayer::addModule |
( |
std::shared_ptr< Module > |
module | ) |
|
void cherrypi::BasePlayer::addModules |
( |
std::vector< std::shared_ptr< Module >> const & |
modules | ) |
|
BasePlayer::ClientCommands cherrypi::BasePlayer::doStep |
( |
| ) |
|
|
protected |
Do the actual per-step work.
void cherrypi::BasePlayer::dumpTraceAlongReplay |
( |
std::string const & |
replayFile | ) |
|
template<typename T >
std::shared_ptr<T> cherrypi::BasePlayer::findModule |
( |
| ) |
|
|
inline |
std::shared_ptr< Module > cherrypi::BasePlayer::getTopModule |
( |
| ) |
const |
virtual void cherrypi::BasePlayer::init |
( |
| ) |
|
|
inlinevirtual |
void cherrypi::BasePlayer::leave |
( |
| ) |
|
void cherrypi::BasePlayer::logFailedCommands |
( |
| ) |
|
|
protected |
void cherrypi::BasePlayer::postStep |
( |
| ) |
|
|
protectedvirtual |
void cherrypi::BasePlayer::preStep |
( |
| ) |
|
|
protectedvirtual |
void cherrypi::BasePlayer::queueCmds |
( |
const std::vector< tc::Client::Command > & |
cmds | ) |
|
Add some commands to the queue, they will be executed on next step()
void cherrypi::BasePlayer::setCheckConsistency |
( |
bool |
check | ) |
|
Set whether to perform consistency checks during the game.
void cherrypi::BasePlayer::setCollectTimers |
( |
bool |
collect | ) |
|
Set whether to gather timing statistics during the game.
void cherrypi::BasePlayer::setDraw |
( |
bool |
draw | ) |
|
Set whether to post drawing commands (if any are posted).
Defaults to true.
void cherrypi::BasePlayer::setLogFailedCommands |
( |
bool |
log | ) |
|
Set whether to log failed commands (via VLOG(0)).
void cherrypi::BasePlayer::setRealtimeFactor |
( |
float |
factor | ) |
|
Delay step() to make the game run in approx. factor*fastest speed.
void cherrypi::BasePlayer::setWarnIfSlow |
( |
bool |
warn | ) |
|
Log a warning if step() exceeds a maximum duration.
Defaults to false.
State* cherrypi::BasePlayer::state |
( |
| ) |
|
|
inline |
void cherrypi::BasePlayer::step |
( |
| ) |
|
void cherrypi::BasePlayer::stepModule |
( |
std::shared_ptr< Module > |
module | ) |
|
|
virtual |
void cherrypi::BasePlayer::stepModules |
( |
| ) |
|
size_t cherrypi::BasePlayer::steps |
( |
| ) |
const |
|
inline |
bool cherrypi::BasePlayer::checkConsistency_ = false |
|
protected |
std::shared_ptr<tc::Client> cherrypi::BasePlayer::client_ |
|
protected |
bool cherrypi::BasePlayer::collectTimers_ = false |
|
protected |
int cherrypi::BasePlayer::combineFrames_ = 3 |
|
protected |
bool cherrypi::BasePlayer::draw_ = true |
|
protected |
bool cherrypi::BasePlayer::firstStepDone_ = false |
|
protected |
int cherrypi::BasePlayer::framesDropped_ = 0 |
|
protected |
int cherrypi::BasePlayer::frameskip_ = 1 |
|
protected |
bool cherrypi::BasePlayer::initialized_ = false |
|
protected |
const std::chrono::seconds cherrypi::BasePlayer::kMaxInitialStepDuration |
|
staticprotected |
Initial value:=
std::chrono::seconds(9)
const std::chrono::milliseconds cherrypi::BasePlayer::kMaxStepDuration |
|
staticprotected |
Initial value:=
std::chrono::milliseconds(40)
const std::chrono::milliseconds cherrypi::BasePlayer::kStepDurationAtFastest |
|
staticprotected |
Initial value:=
std::chrono::milliseconds(42)
int cherrypi::BasePlayer::lastFrameStepped_ = 0 |
|
protected |
hires_clock::time_point cherrypi::BasePlayer::lastStep_ |
|
protected |
bool cherrypi::BasePlayer::logFailedCommands_ = false |
|
protected |
std::vector<std::shared_ptr<Module> > cherrypi::BasePlayer::modules_ |
|
protected |
std::unordered_map<std::shared_ptr<Module>, Duration> cherrypi::BasePlayer::moduleTimeSpent_ |
|
protected |
std::unordered_map<std::shared_ptr<Module>, Duration> cherrypi::BasePlayer::moduleTimeSpentAgg_ |
|
protected |
bool cherrypi::BasePlayer::nonBlocking_ = false |
|
protected |
std::vector<tc::Client::Command> cherrypi::BasePlayer::pendingCmds_ |
|
protected |
float cherrypi::BasePlayer::realtimeFactor_ = -1.0f |
|
protected |
State* cherrypi::BasePlayer::state_ |
|
protected |
Duration cherrypi::BasePlayer::stateUpdateTimeSpent_ |
|
protected |
Duration cherrypi::BasePlayer::stateUpdateTimeSpentAgg_ |
|
protected |
size_t cherrypi::BasePlayer::steps_ = 0 |
|
protected |
std::shared_ptr<Module> cherrypi::BasePlayer::top_ |
|
protected |
bool cherrypi::BasePlayer::warnIfSlow_ = false |
|
protected |
The documentation for this class was generated from the following files: