SkillPointPoolInstance ​
Inherits: RefCounted
Runtime instance tracking state of a skill point pool for a player
Variables ​
SkillPointPool | pool_definition | |
int | total_points_earned | 0 |
int | points_spent | 0 |
Methods ​
SkillPointPoolInstance | create_from_definition( pool_def: SkillPointPool ) static |
int | get_available_points() |
int | get_pool_id() |
String | get_pool_name() |
Color | get_pool_color() |
bool | is_at_cap() |
int | get_remaining_capacity() |
bool | can_add_points( amount: int ) |
bool | add_points( amount: int ) |
bool | can_spend_points( amount: int ) |
bool | spend_points( amount: int ) |
bool | refund_points( amount: int ) |
bool | remove_points( amount: int ) |
void | reset_spent_points() |
String | get_summary() |
float | get_progress_percentage() |
Dictionary | to_save_data() |
void | restore_from_save_data( save_data: Dictionary ) |
SkillPointPoolInstance | from_save_data( save_data: Dictionary, pool_def: SkillPointPool ) static |
Array[Dictionary] | validate() |
bool | is_valid() |
Variable descriptions ​
SkillPointPool pool_definition ​
The pool definition this instance tracks
int total_points_earned = 0 ​
Total points ever earned for this pool
int points_spent = 0 ​
Points currently spent from this pool
Method descriptions ​
SkillPointPoolInstance create_from_definition( pool_def: SkillPointPool ) ​
Factory method to create a new instance from a pool definition
int get_available_points() ​
Get unspent points currently available
int get_pool_id() ​
Get the pool ID this instance tracks
String get_pool_name() ​
Get the display name of this pool
Color get_pool_color() ​
Get the display color for this pool
bool is_at_cap() ​
Check if pool has reached its maximum capacity
int get_remaining_capacity() ​
Get how many more points can be earned (-1 if unlimited)
bool can_add_points( amount: int ) ​
Check if points can be added without exceeding cap
bool add_points( amount: int ) ​
Add points to the pool (increases total_points_earned)
bool can_spend_points( amount: int ) ​
Check if enough points are available to spend
bool spend_points( amount: int ) ​
Spend points from available pool
bool refund_points( amount: int ) ​
Refund spent points back to available
bool remove_points( amount: int ) ​
Take earned points away again (an unapplied reward): only points that are not spent can go
void reset_spent_points() ​
Reset all spent points (full respec of this pool)
String get_summary() ​
Get a summary string for display
float get_progress_percentage() ​
Get percentage of pool capacity used (0.0 to 1.0), returns -1.0 if unlimited
Dictionary to_save_data() ​
Convert instance to save data
void restore_from_save_data( save_data: Dictionary ) ​
Restore state from save data into this existing instance
SkillPointPoolInstance from_save_data( save_data: Dictionary, pool_def: SkillPointPool ) ​
Create instance from save data (legacy/factory method) Prefer using restore_from_save_data() on existing instances
Array[Dictionary] validate() ​
Validate the instance state
bool is_valid() ​
Check if instance is in a valid state