Implement production vertical slice foundation
This commit is contained in:
1 parent
9d4a89f355
commit
a18e82eb44
104 files changed
+10595
-268
No files matched your search
@@ -0,0 +1,22 @@
|
||||
class_name BatterySnapshot
|
||||
extends RefCounted
|
||||
|
||||
var remaining_kwh: float
|
||||
var maximum_kwh: float
|
||||
var ratio: float
|
||||
var current_power_kw: float
|
||||
var endurance_minutes: float
|
||||
|
||||
|
||||
func _init(
|
||||
p_remaining_kwh: float,
|
||||
p_maximum_kwh: float,
|
||||
p_current_power_kw: float
|
||||
) -> void:
|
||||
remaining_kwh = p_remaining_kwh
|
||||
maximum_kwh = p_maximum_kwh
|
||||
ratio = remaining_kwh / maximum_kwh if maximum_kwh > 0.0 else 0.0
|
||||
current_power_kw = p_current_power_kw
|
||||
endurance_minutes = (
|
||||
remaining_kwh / current_power_kw * 60.0 if current_power_kw > 0.0 else INF
|
||||
)
|
||||
Reference in new issue
Block a user