feat: added assetdb

main
Sara 2024-11-24 13:51:02 +01:00
parent d991db980f
commit 4b5bbaf872
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#ifndef CANVAS_ASSET_WRAPPER_HPP
#define CANVAS_ASSET_WRAPPER_HPP
#include <memory>
#include <vector>
class AssetPtrBase {
std::string path{};
std::string name{};
public:
virtual ~AssetPtrBase() = default;
};
template <class AssetType>
class AssetPtr {
std::shared_ptr<AssetType> asset;
public:
AssetPtr();
virtual ~AssetPtr();
};
class AssetDB {
std::vector<std::unique_ptr<AssetPtrBase>> assets;
public:
template <class AssetType> std::shared_ptr<AssetType> load_asset();
};
#endif // !CANVAS_ASSET_WRAPPER_HPP