Thrive
Static Public Member Functions | List of all members
thrive::BioProcessRegistry Class Reference

Static abstract class keeping track of a predefined biological processes, their Id's, internal and displayed names as well as various data. More...

#include <bio_process_registry.h>

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 
static void loadFromXML (const std::string &filename)
 
static BioProcessId registerBioProcess (const std::string &internalName, const std::string &displayName, int energyCost, double speedFactor, std::vector< std::pair< CompoundId, int >> inputCompounds, std::vector< std::pair< CompoundId, int >> outputCompounds)
 Registers a new process type. More...
 
static std::string getDisplayName (BioProcessId id)
 Obtains the display name of an compound. More...
 
static std::string getInternalName (BioProcessId id)
 Obtains the internal name of an compound. More...
 
static double getSpeedFactor (BioProcessId id)
 
static int getEnergyCost (BioProcessId id)
 
static BioProcessId getId (const std::string &internalName)
 Obtains the Id of an internal name corresponding to a registered process. More...
 
static const BoostCompoundMapIterator getList ()
 Obtains the IDs of all currently registered concepts. More...
 
static const std::vector< std::pair< CompoundId, int > > & getInputCompounds (BioProcessId id)
 
static const std::vector< std::pair< CompoundId, int > > & getOutputCompounds (BioProcessId id)
 

Detailed Description

Static abstract class keeping track of a predefined biological processes, their Id's, internal and displayed names as well as various data.

Preferably this would hold process objects in the future, but currently it just holds data for certain lua considerations

Member Function Documentation

std::string BioProcessRegistry::getDisplayName ( BioProcessId  id)
static

Obtains the display name of an compound.

Parameters
idId of the concept to obtain display name from
Returns
Name to display to users
BioProcessId BioProcessRegistry::getId ( const std::string &  internalName)
static

Obtains the Id of an internal name corresponding to a registered process.

Parameters
internalNameThe internal name of the process. Must not already exist in collection or invalid_argument is thrown.
Returns
Id of the process if it is registered. If compound is not registered an out_of_range exception is thrown.
std::string BioProcessRegistry::getInternalName ( BioProcessId  id)
static

Obtains the internal name of an compound.

Parameters
idId of the compound to obtain internal name from
Returns
Compound name for internal use
const BoostCompoundMapIterator BioProcessRegistry::getList ( )
static

Obtains the IDs of all currently registered concepts.

Returns
Array of all registered process IDs
luabind::scope BioProcessRegistry::luaBindings ( )
static

Lua bindings.

Exposes:

BioProcessId BioProcessRegistry::registerBioProcess ( const std::string &  internalName,
const std::string &  displayName,
int  energyCost,
double  speedFactor,
std::vector< std::pair< CompoundId, int >>  inputCompounds,
std::vector< std::pair< CompoundId, int >>  outputCompounds 
)
static

Registers a new process type.

Parameters
internalNameThe name to be used internally for reference across game instances
displayNameName to be displayed to users
energyCostThe amount of energy needed for a full cycle of this process
speedFactorSpeed of this process
inputCompoundsThe compounds and amounts needed for this process
outputCompoundsThe compounds and amounts produced by this process
Returns
Id of new process

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