## Public API Reference

- Main Page
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iPcCharacteristics Struct Reference

This is a characteristics property class. More...

`#include <propclass/chars.h>`

List of all members.

## Public Member Functions

virtual void | AddToInventory (iPcInventory *inv)=0
| Indicate that this object is added to some inventory.
virtual bool | ClearAll ()=0
| Clear all properties.
virtual bool | ClearCharacteristic (const char *name)=0
| Clear a characteristic.
virtual void | Dump ()=0
| Debug dump information.
virtual float | GetCharacteristic (const char *name) const =0
| Get characteristic property.
virtual float | GetInheritedCharacteristic (const char *name) const =0
| Get inherited characteristic property.
virtual float | GetLocalCharacteristic (const char *name) const =0
| Get local characteristic property.
virtual bool | HasCharacteristic (const char *name) const =0
| Returns true if a property is present.
virtual void | MarkDirty (const char *charName)=0
| Mark this characteristic as dirty for all inventories this entity is in.
virtual void | RemoveFromInventory (iPcInventory *inv)=0
| Indicate that this object is removed from some inventory.
virtual bool | SetCharacteristic (const char *name, float value)=0
| Set characteristic property.
virtual bool | SetInheritedCharacteristic (const char *name, float factor, float add)=0
| Indicate how this characteristic is inherited if this object contains an inventory.
virtual bool | TestConstraints (const char *charName)=0
| Test constraints for this characteristic for all inventories this entity is in.

## Detailed Description

This is a characteristics property class.

This property class supports the following properties (add prefix 'cel.property.' to get the ID of the property:

- <name> (float, read/write): the specific characteristic.

Definition at line 38 of file chars.h.

## Member Function Documentation

virtual void iPcCharacteristics::AddToInventory | ( | iPcInventory * | inv | ) | `[pure virtual]`

| Indicate that this object is added to some inventory. This method is meant to be called ONLY by iPcInventory implementations!

virtual bool iPcCharacteristics::ClearAll | ( |  | ) | `[pure virtual]`

| Clear all properties. This function can fail if clearing a property causes a violation of parent inventories. In that case part of the properties may be cleared already.

virtual bool iPcCharacteristics::ClearCharacteristic | ( | const char * | name | ) | `[pure virtual]`

| Clear a characteristic. This can fail if the object is currently in an inventory which requires strict presence of this characteristic.

virtual void iPcCharacteristics::Dump | ( |  | ) | `[pure virtual]`

| Debug dump information.

virtual float iPcCharacteristics::GetCharacteristic | ( | const char * | name | ) | const`[pure virtual]`

| Get characteristic property. This includes inherited characteristics.

virtual float iPcCharacteristics::GetInheritedCharacteristic | ( | const char * | name | ) | const`[pure virtual]`

| Get inherited characteristic property. This ignores local characteristic value.

virtual float iPcCharacteristics::GetLocalCharacteristic | ( | const char * | name | ) | const`[pure virtual]`

| Get local characteristic property. This ignores inherited characteristics.

virtual bool iPcCharacteristics::HasCharacteristic | ( | const char * | name | ) | const`[pure virtual]`

| Returns true if a property is present.

virtual void iPcCharacteristics::MarkDirty | ( | const char * | charName | ) | `[pure virtual]`

| Mark this characteristic as dirty for all inventories this entity is in. If 'charName' == 0 then all characteristics will be marked dirty.

virtual void iPcCharacteristics::RemoveFromInventory | ( | iPcInventory * | inv | ) | `[pure virtual]`

| Indicate that this object is removed from some inventory. This method is meant to be called ONLY by iPcInventory implementations!

virtual bool iPcCharacteristics::SetCharacteristic | ( | const char * | name,
|  | float | value
| ) | `[pure virtual]`

| Set characteristic property. Returns false if this is impossible because the entity is currently in an inventory that does not allow this value.

virtual bool iPcCharacteristics::SetInheritedCharacteristic | ( | const char * | name,
|  | float | factor,
|  | float | add
| ) | `[pure virtual]`

| Indicate how this characteristic is inherited if this object contains an inventory. The default is to ignore contents of inventory for a characteristic ('factor' and 'add' equal to 0). The value of this characteristic of the inventory will be multiplied with 'factor' and added to 'add'. This function can fail if the new properties cause the current contents to fail.

virtual bool iPcCharacteristics::TestConstraints | ( | const char * | charName | ) | `[pure virtual]`

| Test constraints for this characteristic for 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/chars.h