|
Thrive
|
Absorbs compound particles. More...
#include <compound_absorber_system.h>
Public Member Functions | |
| float | absorbedCompoundAmount (CompoundId id) const |
| The absorbed amount in the last time step. More... | |
| bool | canAbsorbCompound (CompoundId id) const |
| Whether an compound can be absorbed. More... | |
| void | setAbsorbtionCapacity (double capacity) |
| Sets the absorbtion capacity. More... | |
| void | enable () |
| void | disable () |
| void | load (const StorageContainer &storage) override |
| Loads the component. More... | |
| void | setAbsorbedCompoundAmount (CompoundId id, float amount) |
| Sets the amount of absorbed compounds. More... | |
| BoostAbsorbedMapIterator | getAbsorbedCompounds () |
| void | setCanAbsorbCompound (CompoundId id, bool canAbsorb) |
| Sets whether an compound can be absorbed. More... | |
| StorageContainer | storage () const override |
| Serializes the component. More... | |
Public Member Functions inherited from thrive::Component | |
| virtual | ~Component ()=0 |
| Destructor. | |
| bool | isVolatile () const |
| A volatile component is not serialized during a save. More... | |
| EntityId | owner () const |
| The entity this component belongs to. More... | |
| void | setVolatile (bool isVolatile) |
| Sets the volatile flag. More... | |
| void | setOwner (EntityId owner) |
| Sets the component's owner. More... | |
| virtual ComponentTypeId | typeId () const =0 |
| The component's type id. | |
| virtual std::string | typeName () const =0 |
| The component's type name. | |
Static Public Member Functions | |
| static luabind::scope | luaBindings () |
| Lua bindings. More... | |
Static Public Member Functions inherited from thrive::Component | |
| static luabind::scope | luaBindings () |
| Lua bindings. More... | |
Public Attributes | |
| std::unordered_map< CompoundId, float > | m_absorbedCompounds |
| The compounds absorbed in the last time step. | |
| std::unordered_set< CompoundId > | m_canAbsorbCompound |
| Whether a particular compound id can be absorbed. | |
| bool | m_enabled = true |
| Whether anything can be absorbed. | |
| double | m_absorbtionCapacity = 0 |
| The amount of compound volume that can be absorbed. | |
Absorbs compound particles.
| float CompoundAbsorberComponent::absorbedCompoundAmount | ( | CompoundId | id | ) | const |
The absorbed amount in the last time step.
| id | The compound id to get the amount for |
| bool CompoundAbsorberComponent::canAbsorbCompound | ( | CompoundId | id | ) | const |
Whether an compound can be absorbed.
| id | The compound id to check |
| void CompoundAbsorberComponent::disable | ( | ) |
Sets m_enabled to false
| void CompoundAbsorberComponent::enable | ( | ) |
Sets m_enabled to true
|
overridevirtual |
|
static |
Lua bindings.
Exposes:
| void CompoundAbsorberComponent::setAbsorbedCompoundAmount | ( | CompoundId | id, |
| float | amount | ||
| ) |
Sets the amount of absorbed compounds.
Use this for e.g. resetting the absorbed amount down to zero.
| id | The compound id to change the amount for |
| amount | The new amount |
| void CompoundAbsorberComponent::setAbsorbtionCapacity | ( | double | capacity | ) |
Sets the absorbtion capacity.
| capacity | The new capacity |
| void CompoundAbsorberComponent::setCanAbsorbCompound | ( | CompoundId | id, |
| bool | canAbsorb | ||
| ) |
Sets whether an compound can be absorbed.
| id | The compound id to set the flag for |
| canAbsorb | Whether to absorb the compound |
|
overridevirtual |
1.8.10