Add explicit stairs and measure elevator congestion with real actors
This commit is contained in:
@@ -44,6 +44,18 @@ const FACILITY_PATHS: Array[String] = [
|
||||
"res://data/facilities/adult_private_room.tres",
|
||||
]
|
||||
|
||||
## Required movement infrastructure added after the original sixteen-facility
|
||||
## catalog. Separate paths preserve the baseline design table and legacy scans.
|
||||
const INFRASTRUCTURE_FACILITY_IDS: Array[StringName] = [
|
||||
&"guest_stairs",
|
||||
&"service_stairs",
|
||||
]
|
||||
|
||||
const INFRASTRUCTURE_FACILITY_PATHS: Array[String] = [
|
||||
"res://data/facilities/infrastructure/guest_stairs.tres",
|
||||
"res://data/facilities/infrastructure/service_stairs.tres",
|
||||
]
|
||||
|
||||
## Optional post-MVP expansion definitions. They live below a subdirectory so
|
||||
## DefinitionRegistry's baseline directory scan remains exactly compatible with
|
||||
## existing saves and the sixteen-facility acceptance fixture.
|
||||
@@ -101,6 +113,14 @@ static func load_expansion() -> Array[FacilityDefinition]:
|
||||
result.append(definition)
|
||||
return result
|
||||
|
||||
static func load_infrastructure() -> Array[FacilityDefinition]:
|
||||
var result: Array[FacilityDefinition] = []
|
||||
for path in INFRASTRUCTURE_FACILITY_PATHS:
|
||||
var definition := load(path) as FacilityDefinition
|
||||
if definition != null:
|
||||
result.append(definition)
|
||||
return result
|
||||
|
||||
static func load_available(include_expansion := false) -> Array[FacilityDefinition]:
|
||||
var result := load_all()
|
||||
if include_expansion:
|
||||
@@ -108,7 +128,9 @@ static func load_available(include_expansion := false) -> Array[FacilityDefiniti
|
||||
return result
|
||||
|
||||
static func by_id(facility_id: StringName) -> FacilityDefinition:
|
||||
for definition in load_available(true):
|
||||
var definitions := load_available(true)
|
||||
definitions.append_array(load_infrastructure())
|
||||
for definition in definitions:
|
||||
if definition.id == facility_id:
|
||||
return definition
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user