Class StatsScalingComponentSO
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
A scaling component that calculates a value based on an entity's stats.
[MovedFrom(true, "ElectricDrill.AstraRpgFramework.Scaling.ScalingComponents", "com.electricdrill.astra-rpg-framework.Runtime", "StatScalingComponent")]
public class StatsScalingComponentSO : SoSetScalingComponentBase<StatSetSO, StatSO>, ITaggable, IValueProvider<StatSO, double>
- Inheritance
-
objectStatsScalingComponentSO
- Implements
- Inherited Members
Methods
GetEntitySet(EntityCore)
Gets the StatSet from the specified entity.
protected override StatSetSO GetEntitySet(EntityCore entity)
Parameters
entityEntityCoreThe entity.
Returns
- StatSetSO
The entity's StatSet, or null if the entity has no EntityStats component.
GetEntityValue(EntityCore, StatSO)
Gets the value of a specific stat from the entity.
protected override long GetEntityValue(EntityCore entity, StatSO key)
Parameters
entityEntityCoreThe entity.
keyStatSOThe stat to get the value of.
Returns
- long
The value of the stat, or 0 if the entity has no EntityStats component.
GetSetItems()
Gets the collection of stats from the associated StatSet.
protected override IEnumerable<StatSO> GetSetItems()
Returns
- IEnumerable<StatSO>
An enumerable of stats.
ValidateEntitySet(EntityCore)
Validates that the entity's StatSet is equal to or contains the scaling component's StatSet. This allows entities with StatSets that include the component's StatSet to be compatible. If the entity's StatSet is null, logs a warning and skips validation.
protected override void ValidateEntitySet(EntityCore entity)
Parameters
entityEntityCoreThe entity to validate