mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
chore: refactor pool allocation and add indirect references
This commit is contained in:
@ -5,10 +5,12 @@
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Zone;
|
||||
class IndirectAssetReference;
|
||||
class XAssetInfoGeneric;
|
||||
|
||||
class ZoneAssetPools
|
||||
@ -17,12 +19,7 @@ protected:
|
||||
Zone* m_zone;
|
||||
std::vector<XAssetInfoGeneric*> m_assets_in_order;
|
||||
|
||||
virtual XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) = 0;
|
||||
virtual XAssetInfoGeneric* AddAssetToPool(std::unique_ptr<XAssetInfoGeneric> xAssetInfo) = 0;
|
||||
|
||||
public:
|
||||
using iterator = std::vector<XAssetInfoGeneric*>::const_iterator;
|
||||
@ -34,14 +31,13 @@ public:
|
||||
ZoneAssetPools& operator=(const ZoneAssetPools& other) = delete;
|
||||
ZoneAssetPools& operator=(ZoneAssetPools&& other) noexcept = default;
|
||||
|
||||
XAssetInfoGeneric*
|
||||
AddAsset(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings);
|
||||
XAssetInfoGeneric* AddAsset(std::unique_ptr<XAssetInfoGeneric> xAssetInfo);
|
||||
XAssetInfoGeneric* AddAsset(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone);
|
||||
std::vector<IndirectAssetReference> indirectAssetReferences);
|
||||
_NODISCARD virtual XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const = 0;
|
||||
_NODISCARD virtual asset_type_t GetAssetTypeCount() const = 0;
|
||||
_NODISCARD virtual const char* GetAssetTypeName(asset_type_t assetType) const = 0;
|
||||
@ -51,6 +47,6 @@ public:
|
||||
|
||||
_NODISCARD size_t GetTotalAssetCount() const;
|
||||
|
||||
iterator begin() const;
|
||||
iterator end() const;
|
||||
_NODISCARD iterator begin() const;
|
||||
_NODISCARD iterator end() const;
|
||||
};
|
||||
|
Reference in New Issue
Block a user