iPcInventory Struct Reference
This is an inventory property class. More...
#include <propclass/inv.h>
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 iCelEntity * | GetEntity (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):
- pcinventory_addchild: new child will be added (entity)
- pcinventory_added: this entity is added as a new child (entity)
- pcinventory_removechild: new child will be removed (entity)
- pcinventory_removed: this entity is removed (entity)
Definition at line 60 of file inv.h.
Member Function Documentation
|
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. |
|
Add an inventory listener. Inventory listeners are called right before the behaviour is called. |
|
This is a debugging function to dump the contents of the inventory and all constraints.
|
|
Get the constraints for some characteristic. Returns false if there are no constraints defined. |
|
Get the current value for some characteristic.
|
|
Get some entity.
|
|
Get the number of entities in this inventory.
|
|
Return the value of 'strict characteristics'.
|
|
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. |
|
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. |
|
Remove all constraints.
|
|
Remove constraints for a characteristic.
|
|
Remove an entity. This can fail if removing an entity causes an upstream inventory to fail its constraints. |
|
Remove an inventory listener.
|
|
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. |
|
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. |
|
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:
- propclass/inv.h
Generated for CEL: Crystal Entity Layer by doxygen 1.4.4