22 lines
1,005 B
GDScript3
22 lines
1,005 B
GDScript3
|
|
class_name BuildingDefinitions
|
||
|
|
extends RefCounted
|
||
|
|
|
||
|
|
const ORDER: PackedStringArray = ["mothership", "ship_crafter", "command_center", "extractor", "transport_hub", "ship_lab", "gas_burner"]
|
||
|
|
const DEFINITIONS: Dictionary = {
|
||
|
|
"mothership": preload("res://buildings/MothershipBuildingDefinition.tres"),
|
||
|
|
"ship_crafter": preload("res://buildings/CrafterBuildingDefinition.tres"),
|
||
|
|
"command_center": preload("res://buildings/CommandBuildingDefinition.tres"),
|
||
|
|
"extractor": preload("res://buildings/ExtractorBuildingDefinition.tres"),
|
||
|
|
"transport_hub": preload("res://buildings/TransportHubBuildingDefinition.tres"),
|
||
|
|
"ship_lab": preload("res://buildings/ShipLabBuildingDefinition.tres"),
|
||
|
|
"gas_burner": preload("res://buildings/GasBurnerBuildingDefinition.tres"),
|
||
|
|
}
|
||
|
|
|
||
|
|
static func get_definition(definition_id: String) -> Resource:
|
||
|
|
return DEFINITIONS.get(definition_id)
|
||
|
|
|
||
|
|
static func all() -> Array:
|
||
|
|
var result: Array = []
|
||
|
|
for definition_id in ORDER:
|
||
|
|
result.append(DEFINITIONS[definition_id])
|
||
|
|
return result
|