Class EntityStats
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public class EntityStats : IEnumerable<KeyValuePair<string, EntityFloatStats>>, IEnumerable
- Inheritance
-
EntityStats
- Implements
- Inherited Members
- Extension Methods
Constructors
EntityStats(Entity)
public EntityStats(Entity entity)
Parameters
entity
Entity
Properties
this[string]
public EntityFloatStats this[string key] { get; set; }
Parameters
key
string
Property Value
Methods
FromTreeAttributes(ITreeAttribute)
public void FromTreeAttributes(ITreeAttribute tree)
Parameters
tree
ITreeAttribute
GetBlended(string)
Get the final stat value, blended by the stats blend type
public float GetBlended(string category)
Parameters
category
string
Returns
GetEnumerator()
public IEnumerator<KeyValuePair<string, EntityFloatStats>> GetEnumerator()
Returns
Register(string, EnumStatBlendType)
Set up a stat. Its not required to call this method, you can go straight to doing .Set() if your blend type is weighted sum. Also initializes a base value of 1.
public EntityStats Register(string category, EnumStatBlendType blendType = EnumStatBlendType.WeightedSum)
Parameters
category
stringblendType
EnumStatBlendType
Returns
Remove(string, string)
Remove a stat value
public EntityStats Remove(string category, string code)
Parameters
Returns
Set(string, string, float, bool)
Set a stat value, if the stat catgory does not exist, it will create a new default one. Initializes a base value of 1 when creating a new stat.
public EntityStats Set(string category, string code, float value, bool persistent = false)
Parameters
Returns
ToTreeAttributes(ITreeAttribute, bool)
public void ToTreeAttributes(ITreeAttribute tree, bool forClient)
Parameters
tree
ITreeAttributeforClient
bool