17 lines
386 B
GDScript
17 lines
386 B
GDScript
class_name SituationProgressSnapshot
|
|
extends RefCounted
|
|
|
|
var situation_id := -1
|
|
var alternative_id: StringName
|
|
var resolved := false
|
|
var current_value := 0.0
|
|
var target_value := 0.0
|
|
var matched_event_id := -1
|
|
var reason_traces: Array[String] = []
|
|
|
|
|
|
func ratio() -> float:
|
|
if target_value <= 0.0:
|
|
return 1.0 if resolved else 0.0
|
|
return clampf(current_value / target_value, 0.0, 1.0)
|