Terrain des sites de plongée : champ de hauteur authoré, Banc du Vigilant, formes variées et rendu sous-marin #4
No files matched your search
@@ -5,8 +5,13 @@ enum Value {
|
|||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
ROCK,
|
ROCK,
|
||||||
METAL,
|
METAL,
|
||||||
|
SAND,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static func is_valid(value: int) -> bool:
|
static func is_valid(value: int) -> bool:
|
||||||
return value >= Value.UNKNOWN and value <= Value.METAL
|
return value >= Value.UNKNOWN and value <= Value.SAND
|
||||||
|
|
||||||
|
|
||||||
|
static func is_terrain(value: int) -> bool:
|
||||||
|
return value == Value.ROCK or value == Value.SAND
|
||||||
@@ -20,7 +20,7 @@ const SonarAcquisitionPort = preload(
|
|||||||
)
|
)
|
||||||
const SonarService = preload("res://game/application/sonar/sonar_service.gd")
|
const SonarService = preload("res://game/application/sonar/sonar_service.gd")
|
||||||
|
|
||||||
const TEST_COUNT := 32
|
const TEST_COUNT := 34
|
||||||
|
|
||||||
var _failures: Array[String] = []
|
var _failures: Array[String] = []
|
||||||
|
|
||||||
@@ -76,6 +76,16 @@ func _test_sample_buffer_contract() -> void:
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
_expect(sample.validation_error().is_empty(), "observed typed sample is valid")
|
_expect(sample.validation_error().is_empty(), "observed typed sample is valid")
|
||||||
|
var sand_sample := SonarSample.new(
|
||||||
|
Vector3(2.0, -4.0, 9.0),
|
||||||
|
Vector3.UP,
|
||||||
|
0.4,
|
||||||
|
-4.0,
|
||||||
|
SonarMaterial.Value.SAND,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
_expect(sand_sample.validation_error().is_empty(), "sand is a valid terrain material")
|
||||||
|
_expect(SonarMaterial.is_valid(SonarMaterial.Value.SAND), "sand is inside the material range")
|
||||||
var buffer := SonarSampleBuffer.new(3, 2)
|
var buffer := SonarSampleBuffer.new(3, 2)
|
||||||
_expect(buffer.set_sample(1, 2, sample).is_empty(), "sample writes inside buffer bounds")
|
_expect(buffer.set_sample(1, 2, sample).is_empty(), "sample writes inside buffer bounds")
|
||||||
_expect(buffer.observed_count() == 1, "buffer counts observed cells")
|
_expect(buffer.observed_count() == 1, "buffer counts observed cells")
|
||||||
|
|||||||
Reference in new issue
Block a user