spaceship/PlanetDefinitions.gd

16 lines
567 B
GDScript3
Raw Normal View History

2026-08-14 16:13:24 +02:00
class_name PlanetDefinitions
extends RefCounted
const ROCKY_ID: String = "rocky"
const GAS_GIANT_ID: String = "gas_giant"
const BLACK_HOLE_ID: String = "black_hole"
2026-08-14 16:13:24 +02:00
const DEFAULT_DEFINITION_ID: String = ROCKY_ID
const DEFINITIONS: Dictionary = {
ROCKY_ID: preload("res://RockyPlanetDefinition.tres"),
GAS_GIANT_ID: preload("res://GasGiantDefinition.tres"),
BLACK_HOLE_ID: preload("res://BlackHolePlanetDefinition.tres"),
2026-08-14 16:13:24 +02:00
}
static func get_definition(definition_id: String) -> Resource:
return DEFINITIONS.get(definition_id, DEFINITIONS[DEFAULT_DEFINITION_ID])