Stat¶
- class Stat(base_value)[source]¶
Bases:
abc.ABC
A container for an Entities Stat and related functionality.
base_value is used as the reference for modifiers. value is the result after modifiers are applied. override forces a specific value to be used, ignoring modifiers.
- apply_modifier(func: Callable, key: Any)[source]¶
Add a modifier
When value is calculated,
func
will be called with the base value- Parameters
func – Any callable function
key – Unique identifier for adding and removing
- property base_value¶
- has_modifier(key: Any)[source]¶
Check if modifier is applied
- Parameters
key – Unique identifier for adding and removing
- remove_modifier(key: Any)[source]¶
Remove a modifier
- Parameters
key – Unique identifier for adding and removing
- property value¶