Extract per-venue geometry specs into WorldBuilder
Add the Hollywood, Joke Shop and TV Studio tables for facade, window, stair, street, nav, guard-spawn and feature data. Unknown ids fall back to the boulevard. Use the specs for the core dimensions and gates, with a headless test for the distinct venue data. Headless 230/230.
This commit is contained in:
1 parent
99f390078d
commit
4cca2af2dd
4 files changed
+198
-62
No files matched your search
@@ -19,6 +19,39 @@ func test_navmesh_built() -> bool:
|
||||
root.free()
|
||||
return a and b
|
||||
|
||||
func test_venue_geometry_specs_are_distinct_and_defaulted() -> bool:
|
||||
var hollywood := WorldBuilder.new(Node3D.new())
|
||||
var joke := WorldBuilder.new(Node3D.new(), "joke_shop")
|
||||
var studio := WorldBuilder.new(Node3D.new(), "tv_studio")
|
||||
var unknown := WorldBuilder.new(Node3D.new(), "not_a_venue")
|
||||
var a := TestUtils.check(hollywood.venue_id == "hollywood_building",
|
||||
"the default venue is Hollywood")
|
||||
var b := TestUtils.check(float(hollywood.spec["facade_width"]) > float(joke.spec["facade_width"]),
|
||||
"the Joke Shop alley is narrower than the boulevard")
|
||||
var c := TestUtils.check(not bool(joke.spec["features"]["skyline"])
|
||||
and not bool(joke.spec["features"]["marquee"]),
|
||||
"the Joke Shop disables the skyline and marquee")
|
||||
var d := TestUtils.check(bool(studio.spec["features"]["bulb_canopy"])
|
||||
and not bool(studio.spec["features"]["marquee"]),
|
||||
"the studio uses a bulb canopy instead of the marquee")
|
||||
var e := TestUtils.check(unknown.venue_id == "hollywood_building",
|
||||
"an unknown venue falls back to Hollywood")
|
||||
var root := Node3D.new()
|
||||
var builder := WorldBuilder.new(root, "joke_shop")
|
||||
builder.build()
|
||||
var body := root.find_child("Building", true, false)
|
||||
var facade := body.get_child(0) as MeshInstance3D if body != null else null
|
||||
var f := TestUtils.check(facade != null and (facade.mesh as BoxMesh).size.x < 20.0,
|
||||
"the Joke Shop builds the narrow facade")
|
||||
var g := TestUtils.check(root.find_child("SkylineBackdrop", true, false) == null,
|
||||
"the Joke Shop builds no skyline ring")
|
||||
hollywood.root.free()
|
||||
joke.root.free()
|
||||
studio.root.free()
|
||||
unknown.root.free()
|
||||
root.free()
|
||||
return a and b and c and d and e and f and g
|
||||
|
||||
func test_phase_lighting_config_covered() -> bool:
|
||||
var ok := true
|
||||
for phase in [Rules.Phase.EARLY, Rules.Phase.MIDDAY, Rules.Phase.EVENING, Rules.Phase.LATE]:
|
||||
|
||||
Reference in new issue
Block a user