TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
A general-purpose unit production module. More...
#include <builder.h>
Inherits cherrypi::Module.
Public Member Functions | |
BuilderModule () | |
virtual | ~BuilderModule ()=default |
virtual void | step (State *s) override |
![]() | |
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) |
Public Attributes | |
std::shared_ptr< BuilderControllerData > | bcdata_ |
Additional Inherited Members | |
![]() | |
template<typename T , typename... Args> | |
static std::shared_ptr< T > | make (Args &&...args) |
static std::shared_ptr< Module > | make (std::string const &typeName) |
static std::string | makeName (std::type_index const &type) |
![]() | |
Module () | |
![]() | |
BasePlayer * | player_ |
std::string | name_ |
A general-purpose unit production module.
This module consumes a Create UPC with a sharp createType and attempts to create it. Units are optional; by default, an appropriate and not-so-busy worker or producer will be selected. Positions are required for buildings that need to be placed by a worker unit.
A build task will be created for every UPC consumed, regardless of current resources, and it will continually be attempted to be built. The exception is that tasks fail if a building that needed to be placed by a worker unit was requested but the desired build location is no longer valid. Units will be created in the order UPCs are consumed, unless we have spare resources which may allow later UPCs to be fulfilled first.
|
inline |
|
virtualdefault |
|
overridevirtual |
Reimplemented from cherrypi::Module.
std::shared_ptr<BuilderControllerData> cherrypi::BuilderModule::bcdata_ |