2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-09 10:07:28 +00:00

chore: refactor IW4 asset loaders

This commit is contained in:
Jan
2024-12-25 21:39:05 +01:00
parent f9456101e6
commit 7ef944ebd4
139 changed files with 2370 additions and 2965 deletions

View File

@@ -0,0 +1,30 @@
#pragma once
#include "Asset/IAssetCreator.h"
#include "Game/IW4/IW4.h"
#include "SearchPath/ISearchPath.h"
#include "StateMap/StateMapDefinition.h"
#include "Techset/TechsetDefinition.h"
#include "Utils/MemoryManager.h"
#include <memory>
#include <string>
namespace IW4
{
[[nodiscard]] std::string GetTechsetFileName(const std::string& techsetAssetName);
[[nodiscard]] std::string GetTechniqueFileName(const std::string& techniqueName);
[[nodiscard]] std::string GetStateMapFileName(const std::string& stateMapName);
class ITechsetCreator : public AssetCreator<AssetTechniqueSet>
{
public:
ITechsetCreator() = default;
virtual ~ITechsetCreator() = default;
virtual techset::TechsetDefinition* LoadTechsetDefinition(const std::string& assetName, AssetCreationContext& context, bool& failure) = 0;
virtual const state_map::StateMapDefinition* LoadStateMapDefinition(const std::string& stateMapName, AssetCreationContext& context) = 0;
};
std::unique_ptr<ITechsetCreator> CreateTechsetLoader(MemoryManager& memory, ISearchPath& searchPath);
} // namespace IW4