spaceship/ResourceDefinitions.gd

18 lines
459 B
GDScript3
Raw Normal View History

2026-08-14 20:32:58 +02:00
class_name ResourceDefinitions
extends RefCounted
const ORE_ID: String = "ore"
const GAS_ID: String = "gas"
const ORDER: PackedStringArray = [ORE_ID, GAS_ID]
const DEFINITIONS: Dictionary = {
ORE_ID: preload("res://OreResourceDefinition.tres"),
GAS_ID: preload("res://GasResourceDefinition.tres"),
}
static func get_definition(resource_id: String) -> Resource:
return DEFINITIONS.get(resource_id)
static func ids() -> PackedStringArray:
return ORDER