18 lines
459 B
GDScript3
18 lines
459 B
GDScript3
|
|
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
|