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

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
 
- 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)
 

Public Attributes

std::shared_ptr< BuilderControllerDatabcdata_
 

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)
 
- Protected Member Functions inherited from cherrypi::Module
 Module ()
 
- Protected Attributes inherited from cherrypi::Module
BasePlayerplayer_
 
std::string name_
 

Detailed Description

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.

Constructor & Destructor Documentation

cherrypi::BuilderModule::BuilderModule ( )
inline
virtual cherrypi::BuilderModule::~BuilderModule ( )
virtualdefault

Member Function Documentation

void cherrypi::BuilderModule::step ( State s)
overridevirtual

Reimplemented from cherrypi::Module.

Member Data Documentation

std::shared_ptr<BuilderControllerData> cherrypi::BuilderModule::bcdata_

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