Class ICharacterAttributeControllerExtensions
Extension methods for ICharacterAttributeController that provide convenience accessors for resource attribute percentages. These are derived from the interface's TryGet methods and do not require implementation-specific knowledge.
public static class ICharacterAttributeControllerExtensions
- Inheritance
-
ICharacterAttributeControllerExtensions
- Inherited Members
Methods
GetHealthResourceAttributeCurrentPercentage(ICharacterAttributeController)
Gets the current health percentage (CurrentValue / FinalValue). Returns 0.0 if the attribute is missing or FinalValue is zero.
public static float GetHealthResourceAttributeCurrentPercentage(this ICharacterAttributeController controller)
Parameters
controllerICharacterAttributeControllerThe attribute controller.
Returns
- float
Current health percentage as a float in the range [0.0, 1.0].
GetManaResourceAttributeCurrentPercentage(ICharacterAttributeController)
Gets the current mana percentage (CurrentValue / FinalValue). Returns 0.0 if the attribute is missing or FinalValue is zero.
public static float GetManaResourceAttributeCurrentPercentage(this ICharacterAttributeController controller)
Parameters
controllerICharacterAttributeControllerThe attribute controller.
Returns
- float
Current mana percentage as a float in the range [0.0, 1.0].
GetStaminaResourceAttributeCurrentPercentage(ICharacterAttributeController)
Gets the current stamina percentage (CurrentValue / FinalValue). Returns 0.0 if the attribute is missing or FinalValue is zero.
public static float GetStaminaResourceAttributeCurrentPercentage(this ICharacterAttributeController controller)
Parameters
controllerICharacterAttributeControllerThe attribute controller.
Returns
- float
Current stamina percentage as a float in the range [0.0, 1.0].