mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
Save scriptstrings per zone and not per asset since that solves all problems with multiple assets of the same zone referencing the same struct in memory that has scriptstring indices
This commit is contained in:
35
src/ZoneCommon/Pool/ZoneAssetPools.h
Normal file
35
src/ZoneCommon/Pool/ZoneAssetPools.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "XAssetInfo.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Zone/Zone.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class Zone;
|
||||
class XAssetInfoGeneric;
|
||||
|
||||
class ZoneAssetPools
|
||||
{
|
||||
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) = 0;
|
||||
|
||||
public:
|
||||
using iterator = std::vector<XAssetInfoGeneric*>::const_iterator;
|
||||
|
||||
explicit ZoneAssetPools(Zone* zone);
|
||||
virtual ~ZoneAssetPools() = default;
|
||||
|
||||
XAssetInfoGeneric* AddAsset(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*>& dependencies);
|
||||
virtual XAssetInfoGeneric* GetAsset(asset_type_t type, std::string name) const = 0;
|
||||
virtual const std::string& GetAssetTypeName(asset_type_t assetType) const = 0;
|
||||
|
||||
virtual void InitPoolStatic(asset_type_t type, size_t capacity) = 0;
|
||||
virtual void InitPoolDynamic(asset_type_t type) = 0;
|
||||
|
||||
iterator begin() const;
|
||||
iterator end() const;
|
||||
};
|
Reference in New Issue
Block a user