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

Scouts the enemy's base with a worker. More...

#include <harass.h>

Inherits cherrypi::Module.

Classes

struct  BuildPolicy
 
struct  FleePolicy
 
struct  TargetPolicy
 

Public Member Functions

virtual ~HarassModule ()=default
 
virtual void step (State *s) override
 
void postCommand (State *state, MasterHarassTask *htask)
 
void postCommand (State *state, HarassTask *htask)
 
void postCommand (State *state, BuildingHarassTask *htask)
 
void setTargetPolicy (TargetPolicy pol)
 
void setBuildPolicy (BuildPolicy pol)
 
void setFleePolicy (FleePolicy pol)
 
- Public Member Functions inherited from cherrypi::Module
virtual ~Module ()=default
 
virtual void setPlayer (BasePlayer *p)
 
void setName (std::string name)
 
std::string name ()
 
virtual void onGameStart (State *s)
 
virtual void onGameEnd (State *s)
 

Protected Member Functions

bool attack (State *state, HarassTask *htask)
 
bool attackResourceDepot (State *state, HarassTask *htask)
 
bool attackWorkers (State *state, HarassTask *htask)
 
bool dangerousAttack (State *state, HarassTask *task)
 
bool buildRefinery (State *state, HarassTask *task)
 
bool flee (State *state, HarassTask *task)
 
bool exploreEnemyBase (State *state, HarassTask *task)
 
std::vector< PositiongetFleePositions (State *state, HarassTask *task)
 
void consumeUPC (State *state, UpcId upcId, std::shared_ptr< UPCTuple > upc)
 
std::shared_ptr< MasterHarassTaskcreateTask (State *, UpcId, std::shared_ptr< UPCTuple >)
 
UnitenemyGeyser (Position const &pos)
 
UnitenemyRefinery (Position const &pos)
 
void findClosestGeyser (State *state, Position const &nmyLoc)
 
void checkEnemyRefineryBuilt (State *state, Position const &nmyLoc)
 
- Protected Member Functions inherited from cherrypi::Module
 Module ()
 

Protected Attributes

TargetPolicy targetPolicy_
 
BuildPolicy buildPolicy_
 
FleePolicy fleePolicy_
 
std::unordered_map< Position, Unit * > enemyGeyser_
 
std::unordered_map< Position, Unit * > enemyRefinery_
 
- Protected Attributes inherited from cherrypi::Module
BasePlayerplayer_
 
std::string name_
 

Additional Inherited Members

- Static Public Member Functions inherited from cherrypi::Module
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)
 

Detailed Description

Scouts the enemy's base with a worker.

Harasses the enemy while scouting.

Constructor & Destructor Documentation

virtual cherrypi::HarassModule::~HarassModule ( )
virtualdefault

Member Function Documentation

bool cherrypi::HarassModule::attack ( State state,
HarassTask htask 
)
protected
bool cherrypi::HarassModule::attackResourceDepot ( State state,
HarassTask htask 
)
protected
bool cherrypi::HarassModule::attackWorkers ( State state,
HarassTask htask 
)
protected
bool cherrypi::HarassModule::buildRefinery ( State state,
HarassTask task 
)
protected
void cherrypi::HarassModule::checkEnemyRefineryBuilt ( State state,
Position const &  nmyLoc 
)
protected
void cherrypi::HarassModule::consumeUPC ( State state,
UpcId  upcId,
std::shared_ptr< UPCTuple upc 
)
protected
std::shared_ptr< MasterHarassTask > cherrypi::HarassModule::createTask ( State state,
UpcId  upcId,
std::shared_ptr< UPCTuple upc 
)
protected
bool cherrypi::HarassModule::dangerousAttack ( State state,
HarassTask task 
)
protected
Unit * cherrypi::HarassModule::enemyGeyser ( Position const &  pos)
protected
Unit * cherrypi::HarassModule::enemyRefinery ( Position const &  pos)
protected
bool cherrypi::HarassModule::exploreEnemyBase ( State state,
HarassTask task 
)
protected
void cherrypi::HarassModule::findClosestGeyser ( State state,
Position const &  nmyLoc 
)
protected
bool cherrypi::HarassModule::flee ( State state,
HarassTask task 
)
protected
std::vector< Position > cherrypi::HarassModule::getFleePositions ( State state,
HarassTask task 
)
protected
void cherrypi::HarassModule::postCommand ( State state,
MasterHarassTask htask 
)
inline
void cherrypi::HarassModule::postCommand ( State state,
HarassTask htask 
)
void cherrypi::HarassModule::postCommand ( State state,
BuildingHarassTask htask 
)
void cherrypi::HarassModule::setBuildPolicy ( BuildPolicy  pol)
inline
void cherrypi::HarassModule::setFleePolicy ( FleePolicy  pol)
inline
void cherrypi::HarassModule::setTargetPolicy ( TargetPolicy  pol)
inline
void cherrypi::HarassModule::step ( State s)
overridevirtual

Reimplemented from cherrypi::Module.

Member Data Documentation

BuildPolicy cherrypi::HarassModule::buildPolicy_
protected
std::unordered_map<Position, Unit*> cherrypi::HarassModule::enemyGeyser_
protected
std::unordered_map<Position, Unit*> cherrypi::HarassModule::enemyRefinery_
protected
FleePolicy cherrypi::HarassModule::fleePolicy_
protected
TargetPolicy cherrypi::HarassModule::targetPolicy_
protected

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