class_name BuildingDefinitions extends RefCounted const ORDER: PackedStringArray = ["mothership", "ship_crafter", "command_center", "outpost", "planning_center", "spacial_workshop", "planet_scanner", "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"), "outpost": preload("res://buildings/OutpostBuildingDefinition.tres"), "planning_center": preload("res://buildings/PlanningBuildingDefinition.tres"), "spacial_workshop": preload("res://buildings/WorkshopBuildingDefinition.tres"), "planet_scanner": preload("res://buildings/ScannerBuildingDefinition.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