33 static AssetType GetStaticAssetType() {
return internalAssetType; }
35 virtual void* IncrementAssetUse(
Uuid uuid)
override {
36 void* output =
nullptr;
37 if (TryGetIfLoaded(uuid, output)) {
38 AssetStructType* asset =
static_cast<AssetStructType*
>(output);
39 ++asset->referenceCount;
43 return ProcessLoadedFile(uuid);
49 virtual void DecrementAssetUse(
Uuid uuid)
override {
50 void* output =
nullptr;
51 if (TryGetIfLoaded(uuid, output) && output !=
nullptr) {
52 AssetStructType* asset =
static_cast<AssetStructType*
>(output);
53 if (asset->referenceCount <= 1) {
57 --asset->referenceCount;
62 virtual bool TryGetIfLoaded(
Uuid uuid,
void*& output)
override {
63 auto assetInMap = assets.find(uuid);
64 if (assetInMap != assets.end()) {
65 output = &assetInMap->second;
72 size_t AssetCount()
const {
return assets.size(); }
73 bool HasAssets()
const {
return assets.size() != 0; }
75 auto begin()
noexcept {
return assets.begin(); }
76 auto cbegin()
const noexcept {
return assets.begin(); }
77 auto end()
noexcept {
return assets.end(); }
78 auto cend()
const noexcept {
return assets.cend(); }
81 std::map<Uuid, AssetStructType> assets;