TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cherrypi::Module Class Reference

Interface for bot modules. More...

#include <module.h>

Inherited by cherrypi::AutoBuildModule, cherrypi::BuilderModule, cherrypi::BuildingPlacerModule, cherrypi::CherryVisDumperModule, cherrypi::CombatMicroModule, cherrypi::CombatModule, cherrypi::CreateGatherAttackModule, cherrypi::DummyTacticsModule, cherrypi::GathererModule, cherrypi::HarassModule, cherrypi::LambdaModule, cherrypi::ScoutingModule, cherrypi::SquadCombatModule, cherrypi::StaticDefenceFocusFireModule, cherrypi::StrategyModule, cherrypi::TacticsModule, cherrypi::TopModule, and cherrypi::UPCToCommandModule.

Public Member Functions

virtual ~Module ()=default
 
virtual void setPlayer (BasePlayer *p)
 
void setName (std::string name)
 
std::string name ()
 
virtual void step (State *s)
 
virtual void onGameStart (State *s)
 
virtual void onGameEnd (State *s)
 

Static Public Member Functions

template<typename T , typename... Args>
static std::shared_ptr< T > make (Args &&...args)
 
static std::shared_ptr< Modulemake (std::string const &typeName)
 
static std::string makeName (std::type_index const &type)
 

Protected Member Functions

 Module ()
 

Protected Attributes

BasePlayerplayer_
 
std::string name_
 

Detailed Description

Interface for bot modules.

Use Module::make<T>(args) to construct a new module instance of a given type.

Constructor & Destructor Documentation

virtual cherrypi::Module::~Module ( )
virtualdefault
cherrypi::Module::Module ( )
protected

Member Function Documentation

template<typename T , typename... Args>
static std::shared_ptr<T> cherrypi::Module::make ( Args &&...  args)
inlinestatic
std::shared_ptr< Module > cherrypi::Module::make ( std::string const &  typeName)
static
std::string cherrypi::Module::makeName ( std::type_index const &  type)
static
std::string cherrypi::Module::name ( )
virtual void cherrypi::Module::onGameEnd ( State s)
inlinevirtual
virtual void cherrypi::Module::onGameStart ( State s)
inlinevirtual
void cherrypi::Module::setName ( std::string  name)
virtual void cherrypi::Module::setPlayer ( BasePlayer p)
inlinevirtual
virtual void cherrypi::Module::step ( State s)
inlinevirtual

Member Data Documentation

std::string cherrypi::Module::name_
protected
BasePlayer* cherrypi::Module::player_
protected

The documentation for this class was generated from the following files: