manages the modification and observation of a defined set of attributes and stats
has built in support for stats that define a resources maximum(max health, max stamine, ...)
https://adventure.softleitner.com/manual/attribute
|
void | Add (AttributeType type, int quantity) |
| adds to the value of an attribute
|
|
void | Remove (AttributeType type, int quantity) |
| removes from the value of an attribute
|
|
bool | HasValue (AttributeValue attributeValue) |
| checks if the current value of an attribute is at least as large as the one passed
|
|
bool | HasValues (IEnumerable< AttributeValue > attributeValues) |
|
bool | HasValue (AttributeStatValue attributeStatValue) |
|
bool | HasValues (IEnumerable< AttributeStatValue > attributeStatValues) |
|
IEnumerable< AttributeValue > | GetValues () |
|
int | GetValue (AttributeType attribute) |
| applies all modifiers and returns the attribute value
|
|
int | GetRawValue (AttributeType attribute) |
| returns the attribute value without modifiers
|
|
int | GetValue (AttributeStat stat) |
| applies all modifiers and returns the stat value
|
|
void | AddObserver (AttributeType attribute, Action< int > callback) |
| add a callback that will be called whenever an attribute changes
changes can occur when the value changes or modifiers are added or removed
|
|
void | RemoveObserver (AttributeType attribute, Action< int > callback) |
| removes an observing action that was added in AddObserver(AttributeType, Action<int>)
|
|
void | AddObserver (AttributeStat stat, Action< int > callback) |
| add a callback that will be called whenever a stat changes
changes can occur when the attribute changes or modifiers are added or removed
|
|
void | RemoveObserver (AttributeStat stat, Action< int > callback) |
| removes an observing action that was added in AddObserver(AttributeStat, Action<int>)
|
|
void | AddModifier (IAttributeModifier attributeModifier) |
| adds a modifier for attributes, observers will be notified
|
|
void | RemoveModifier (IAttributeModifier attributeModifier) |
| removes a modifier for attributes, observers will be notified
|
|
void | AddModifier (IStatModifier statModifier) |
| adds a modifier for stats, observers will be notified
|
|
void | RemoveModifier (IStatModifier statModifier) |
| removes a modifier for stats, observers will be notified
|
|
AttributeData | GetData () |
| collects all the state from attributes and puts it into a AttributeData that can be serialized
may be used from outside when attributedata is put into a larger structure that is persisted and no persister is set up here
|
|
void | Persist () |
|