#include "Main.h"

#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/packed_scene.hpp>
#include <godot_cpp/classes/resource_loader.hpp>
#include <godot_cpp/classes/scene_tree.hpp>
#include <godot_cpp/classes/window.hpp>
#include <godot_cpp/variant/utility_functions.hpp>

#include "Lobby.h"
#include "World.h"

using namespace godot;

namespace blitz {

static constexpr char MainScenePath[] = "res://Scenes/Levels/world.tscn";

void Main::_bind_methods() {
	godot::ClassDB::bind_method(godot::D_METHOD("change_scene"), &Main::ChangeScene);
}

Main::Main() {}

Main::~Main() {}

void Main::ChangeScene() {
	Ref<PackedScene> sceneData = ResourceLoader::get_singleton()->load(MainScenePath);
	World* world = Object::cast_to<World>(sceneData->instantiate());
	add_child(world);
}

}  // namespace blitz