33 lines
661 B
C++
33 lines
661 B
C++
// Copyright (c) 2024 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "asset/AssetLoader.hpp"
|
|
#include "asset/AssetDataLoader.hpp"
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
namespace Dawn {
|
|
enum class JSONLoaderState {
|
|
INITIAL,
|
|
LOADING_JSON,
|
|
DONE
|
|
};
|
|
|
|
class JSONLoader : public AssetLoader {
|
|
protected:
|
|
AssetDataLoader loader;
|
|
enum JSONLoaderState state;
|
|
|
|
public:
|
|
json data;
|
|
|
|
JSONLoader(const std::string name);
|
|
void updateSync() override;
|
|
void updateAsync() override;
|
|
~JSONLoader();
|
|
};
|
|
} |