april  1.0.0
...
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
april::Factory Class Reference

Base class for factory classes. More...

#include <factory.h>

+ Inheritance diagram for april::Factory:

Public Member Functions

 Factory (World *w)
 constructor;
virtual FactoryType factoryType (void)
 the generic type of the factory
virtual QString factoryName (void)
 the name used to save this factory
Worldworld (void) const
 the world that hosts us;
virtual const QString & name (ID id) const
 name of the element represented by provided ID
virtual QList< qreal > averageDNA (ID id) const
 get the default DNA sequence for a particular ID
virtual bool save (QSettings &s) const
 save to a QSettings object
virtual bool load (QSettings &s)
 load from a QSettings object

Protected Member Functions

virtual ~Factory (void)
 destructor;
void setName (const QString &s)
 chang the name of the element represented by provided ID
bool setEnergy (ActorComp *comp, quint64 energy, quint64 cost)
 set the packed energy and the ammount of energy consumed on each time unit

Friends

class ActorComp

Detailed Description

Base class for factory classes.

Member Function Documentation

bool Factory::setEnergy ( ActorComp comp,
quint64  energy,
quint64  cost 
)
protected

set the packed energy and the ammount of energy consumed on each time unit

This is a simple shortcut to World::setEnergy(). If the world does not have that much energy the opperation is dropped.

Parameters
compthe component where this is to be set
energypacked energy (will be substracted from world's free energy)
costenergy consumed on each step by this component
Returns
true if the opperation succeded

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