CEL

Public API Reference

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

iPcInventory Struct Reference

This is an inventory property class. More...

#include <propclass/inv.h>

List of all members.

Public Member Functions

virtual void AddInventoryListener (iPcInventoryListener *listener)=0
 Add an inventory listener.
virtual void RemoveInventoryListener (iPcInventoryListener *listener)=0
 Remove an inventory listener.
virtual bool AddEntity (iCelEntity *entity)=0
 Add an entity.
virtual bool RemoveEntity (iCelEntity *entity)=0
 Remove an entity.
virtual bool RemoveAll ()=0
 Remove all entities.
virtual size_t GetEntityCount () const =0
 Get the number of entities in this inventory.
virtual iCelEntityGetEntity (size_t idx) const =0
 Get some entity.
virtual bool SetStrictCharacteristics (const char *charName, bool strict)=0
 If true reject any entities that don't have this characteristic.
virtual bool HasStrictCharacteristics (const char *charName) const =0
 Return the value of 'strict characteristics'.
virtual bool SetConstraints (const char *charName, float minValue, float maxValue, float totalMaxValue)=0
 Set the constraints for some characteristic.
virtual bool GetConstraints (const char *charName, float &minValue, float &maxValue, float &totalMaxValue) const =0
 Get the constraints for some characteristic.
virtual void RemoveConstraints (const char *charName)=0
 Remove constraints for a characteristic.
virtual void RemoveAllConstraints ()=0
 Remove all constraints.
virtual float GetCurrentCharacteristic (const char *charName) const =0
 Get the current value for some characteristic.
virtual void MarkDirty (const char *charName)=0
 Mark this characteristic as dirty for this inventory and all inventories this entity is in.
virtual bool TestConstraints (const char *charName)=0
 Test constraints for this characteristic for this inventory and all inventories * this entity is in.
virtual void Dump ()=0
 This is a debugging function to dump the contents of the inventory and all constraints.


Detailed Description

This is an inventory property class.

This property class can send out the following messages to the behaviour (possibly the behaviour of the child entity too): (add prefix 'cel.parameter.' to get the ID for parameters):

Definition at line 60 of file inv.h.


Member Function Documentation

virtual bool iPcInventory::AddEntity iCelEntity entity  )  [pure virtual]
 

Add an entity.

Returns false if the entity could not be added (capacity exceeded for example). Note that it is safe to add entities that are already in the inventory. Nothing will happen then and true will be returned.

virtual void iPcInventory::AddInventoryListener iPcInventoryListener listener  )  [pure virtual]
 

Add an inventory listener.

Inventory listeners are called right before the behaviour is called.

virtual void iPcInventory::Dump  )  [pure virtual]
 

This is a debugging function to dump the contents of the inventory and all constraints.

virtual bool iPcInventory::GetConstraints const char *  charName,
float &  minValue,
float &  maxValue,
float &  totalMaxValue
const [pure virtual]
 

Get the constraints for some characteristic.

Returns false if there are no constraints defined.

virtual float iPcInventory::GetCurrentCharacteristic const char *  charName  )  const [pure virtual]
 

Get the current value for some characteristic.

virtual iCelEntity* iPcInventory::GetEntity size_t  idx  )  const [pure virtual]
 

Get some entity.

virtual size_t iPcInventory::GetEntityCount  )  const [pure virtual]
 

Get the number of entities in this inventory.

virtual bool iPcInventory::HasStrictCharacteristics const char *  charName  )  const [pure virtual]
 

Return the value of 'strict characteristics'.

virtual void iPcInventory::MarkDirty const char *  charName  )  [pure virtual]
 

Mark this characteristic as dirty for this inventory and all inventories this entity is in.

If 'charName' == 0 then all characteristics will be marked dirty.

virtual bool iPcInventory::RemoveAll  )  [pure virtual]
 

Remove all entities.

This can fail if removing entities causes upstream inventories to fail its constraints. In that case entities are removed until the first failure. To ensure correct removal for this inventory you should first clear all constraints.

virtual void iPcInventory::RemoveAllConstraints  )  [pure virtual]
 

Remove all constraints.

virtual void iPcInventory::RemoveConstraints const char *  charName  )  [pure virtual]
 

Remove constraints for a characteristic.

virtual bool iPcInventory::RemoveEntity iCelEntity entity  )  [pure virtual]
 

Remove an entity.

This can fail if removing an entity causes an upstream inventory to fail its constraints.

virtual void iPcInventory::RemoveInventoryListener iPcInventoryListener listener  )  [pure virtual]
 

Remove an inventory listener.

virtual bool iPcInventory::SetConstraints const char *  charName,
float  minValue,
float  maxValue,
float  totalMaxValue
[pure virtual]
 

Set the constraints for some characteristic.

There is a min and max value for one entity and also a total max value for the entire inventory.

This function can fail if the new constraints cause current contents to be invalidated.

virtual bool iPcInventory::SetStrictCharacteristics const char *  charName,
bool  strict
[pure virtual]
 

If true reject any entities that don't have this characteristic.

By default this is false which means that the inventory will automatically assume valid values when this characteristic is not present.

This function can fail if this inventory already has contents and entities in this inventory do not satisfy the strict condition.

virtual bool iPcInventory::TestConstraints const char *  charName  )  [pure virtual]
 

Test constraints for this characteristic for this inventory and all inventories * this entity is in.

If 'charName' == 0 then all characteristics will be tested.


The documentation for this struct was generated from the following file:
Generated for CEL: Crystal Entity Layer by doxygen 1.4.4