extends Node3D

enum EnumWorld {CUBIC_WORLD, SMOOTH_WORLD}

@export var wanted_world: EnumWorld

var enabled_world: EnumWorld = EnumWorld.CUBIC_WORLD

var smooth_world = preload("res://SurfaceNetsWorld/smooth_world.tscn")
var cubic_world = preload("res://cubic_world.tscn")

signal change_world

func _process(_delta: float) -> void:
	if enabled_world != wanted_world:
		print("changing world")
		emit_signal("change_world")
	
func _on_change_world():
	match wanted_world:
		EnumWorld.CUBIC_WORLD:
			add_child(cubic_world.instantiate())
		EnumWorld.SMOOTH_WORLD:
			add_child(smooth_world.instantiate())
	enabled_world = wanted_world
