Class Stat
Class that represents a stat.
Inheritance
Implements
Inherited Members
Namespace: Fibula.Creatures
Assembly: Fibula.Creatures.dll
Syntax
public class Stat : IStat
Constructors
| Improve this Doc View SourceStat(CreatureStat, UInt32, UInt32)
Initializes a new instance of the Stat class.
Declaration
public Stat(CreatureStat statType, uint currentValue, uint maxValue)
Parameters
Type | Name | Description |
---|---|---|
CreatureStat | statType | The stat type. |
System.UInt32 | currentValue | The current stat value. |
System.UInt32 | maxValue | The maximum value that the stat can reach. |
Properties
| Improve this Doc View SourceCurrent
Gets this stat's current value.
Declaration
public uint Current { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Maximum
Gets this stat's maximum value.
Declaration
public uint Maximum { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Percent
Gets the current percentual value between current and maximum values.
Declaration
public byte Percent { get; }
Property Value
Type | Description |
---|---|
System.Byte |
Type
Gets this stat's id.
Declaration
public CreatureStat Type { get; }
Property Value
Type | Description |
---|---|
CreatureStat |
Methods
| Improve this Doc View SourceDecrease(Int32)
Decreases this stats's value.
Declaration
public bool Decrease(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The amount by which to decrease this stat's value. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value was actually decreased, false otherwise. |
Increase(Int32)
Increases this stats's value.
Declaration
public bool Increase(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The amount by which to increase this stat's value. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value was actually increased, false otherwise. |
Set(UInt32)
Sets this stats's value.
Declaration
public bool Set(uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value to set in the stat. This is bounded by [0, Maximum]. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value was actually changed, false otherwise. |
Events
| Improve this Doc View SourceChanged
Event triggered when this stat changes.
Declaration
public event OnStatChanged Changed
Event Type
Type | Description |
---|---|
OnStatChanged |