Dawn/src/dawn/asset/loader/SceneLoader.hpp

40 lines
863 B
C++

// Copyright (c) 2024 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "JSONLoader.hpp"
#include "scene/Scene.hpp"
namespace Dawn {
enum class SceneLoaderState {
INITIAL,
LOADING_JSON,
};
class SceneLoader : public AssetLoader {
protected:
SceneLoaderState state;
std::shared_ptr<JSONLoader> jsonLoader;
std::shared_ptr<Scene> scene;
public:
SceneLoader(
const std::shared_ptr<AssetManager> assetManager,
const std::string name
);
void updateSync() override;
void updateAsync() override;
/**
* Returns the Scene that was loaded, or nullptr if not loaded.
*
* @return The loaded scene.
*/
std::shared_ptr<Scene> getScene();
~SceneLoader();
};
}