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,31 @@
|
||||
class_name CollisionObservation
|
||||
extends RefCounted
|
||||
|
||||
var observation_id: StringName
|
||||
var sequence: int
|
||||
var tick_sequence: int
|
||||
var normal_impact_speed_mps: float
|
||||
|
||||
|
||||
func _init(
|
||||
p_observation_id: StringName,
|
||||
p_sequence: int,
|
||||
p_tick_sequence: int,
|
||||
p_normal_impact_speed_mps: float
|
||||
) -> void:
|
||||
observation_id = p_observation_id
|
||||
sequence = p_sequence
|
||||
tick_sequence = p_tick_sequence
|
||||
normal_impact_speed_mps = p_normal_impact_speed_mps
|
||||
|
||||
|
||||
func validation_error(expected_tick_sequence: int) -> String:
|
||||
if observation_id.is_empty():
|
||||
return "collision observation_id is empty"
|
||||
if sequence < 0:
|
||||
return "collision sequence is negative"
|
||||
if tick_sequence != expected_tick_sequence:
|
||||
return "collision tick sequence does not match DiveTick"
|
||||
if not is_finite(normal_impact_speed_mps) or normal_impact_speed_mps < 0.0:
|
||||
return "collision speed must be finite and non-negative"
|
||||
return ""
|
||||
Reference in new issue
Block a user