| ## Public API Reference

- Main Page
- Classes
- Files

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

# iPcRules Struct Reference

This property class represents a set of active rules for an entity. More...

`#include <propclass/rules.h>`

List of all members.

## Public Member Functions
virtual void | AddRule (iCelRule *rule, csTicks time)=0
| Add a rule which times out after a specific amount of time.
virtual void | AddRule (iCelRule *rule)=0
| Add a rule.
virtual void | DeleteAllRules ()=0
| Delete all rules.
virtual void | DeleteRule (iCelRule *rule)=0
| Delete a rule.
virtual bool | GetProperty (const char *name, celData &ret)=0
| Get a specific property.
virtual bool | GetPropertyBool (const char *name)=0
| Get a specific property.
virtual bool | GetPropertyColor (const char *name, csColor &v)=0
| Get a specific property.
virtual float | GetPropertyFloat (const char *name)=0
| Get a specific property.
virtual long | GetPropertyLong (const char *name)=0
| Get a specific property.
virtual const char * | GetPropertyString (const char *name)=0
| Get a specific property.
virtual celDataType | GetPropertyType (const char *name)=0
| Get the type of the property.
virtual bool | GetPropertyVector (const char *name, csVector3 &v)=0
| Get a specific property.
virtual bool | GetPropertyVector (const char *name, csVector2 &v)=0
| Get a specific property.

## Detailed Description

This property class represents a set of active rules for an entity.

It uses the rule base system (iCelRuleBase). Note that this property class will automatically load the rule base system if it is missing. When reading properties out of this pcrules it will check if there are any rules affecting the property. If not you will simply get the value from the associated 'pcproperties' property class (if present). Otherwise you will get a modified value according to the rules defined for this property (starting from the value out of pcproperties). If the 'pcproperties' is not present a default value is assumed (0 for numbers, empty string for string, 0-vector for vectors, and black for colors).

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

- pcrules_modifypar: a parameter has been modified: parameters 'name' (name of the parameter).

This property class supports the following actions (add prefix 'cel.action.' to get the ID of the action and add prefix 'cel.parameter.' to get the ID of the parameter):

- AddRule: parameters 'name' (string). Optional 'time' (long) parameter.
- DeleteRule: parameters 'name' (string).
- DeleteAllRules: no parameters.

Definition at line 58 of file rules.h.

## Member Function Documentation

virtual void iPcRules::AddRule | ( | iCelRule * | rule,
|  | csTicks | time
| ) | `[pure virtual]`

| Add a rule which times out after a specific amount of time.

virtual void iPcRules::AddRule | ( | iCelRule * | rule | ) | `[pure virtual]`

| Add a rule.

virtual void iPcRules::DeleteAllRules | ( |  | ) | `[pure virtual]`

| Delete all rules.

virtual void iPcRules::DeleteRule | ( | iCelRule * | rule | ) | `[pure virtual]`

| Delete a rule.

virtual bool iPcRules::GetProperty | ( | const char * | name,
|  | celData & | ret
| ) | `[pure virtual]`

| Get a specific property.

virtual bool iPcRules::GetPropertyBool | ( | const char * | name | ) | `[pure virtual]`

| Get a specific property.

virtual bool iPcRules::GetPropertyColor | ( | const char * | name,
|  | csColor & | v
| ) | `[pure virtual]`

| Get a specific property.

virtual float iPcRules::GetPropertyFloat | ( | const char * | name | ) | `[pure virtual]`

| Get a specific property.

virtual long iPcRules::GetPropertyLong | ( | const char * | name | ) | `[pure virtual]`

| Get a specific property.

virtual const char* iPcRules::GetPropertyString | ( | const char * | name | ) | `[pure virtual]`

| Get a specific property.

virtual celDataType iPcRules::GetPropertyType | ( | const char * | name | ) | `[pure virtual]`

| Get the type of the property. This will base itself on the underlying pcproperties. If there is no pcproperties class with the right property in it then this will return CEL_DATA_NONE even though getting a specific typed value might work.

virtual bool iPcRules::GetPropertyVector | ( | const char * | name,
|  | csVector3 & | v
| ) | `[pure virtual]`

| Get a specific property.

virtual bool iPcRules::GetPropertyVector | ( | const char * | name,
|  | csVector2 & | v
| ) | `[pure virtual]`

| Get a specific property.

The documentation for this struct was generated from the following file:

- propclass/rules.h