diff --git a/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.cpp b/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.cpp similarity index 80% rename from src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.cpp rename to src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.cpp index aab09be9..af02ffd7 100644 --- a/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.cpp +++ b/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.cpp @@ -1,4 +1,4 @@ -#include "KeyValuePairsCreator.h" +#include "KeyValuePairsCompiler.h" #include "Game/T6/CommonT6.h" #include "Game/T6/T6.h" @@ -8,18 +8,23 @@ using namespace T6; -KeyValuePairsCreator::KeyValuePairsCreator(const Zone& zone, const ZoneDefinition& zoneDefinition) +KeyValuePairsCompiler::KeyValuePairsCompiler(const Zone& zone, const ZoneDefinition& zoneDefinition) : m_zone(zone), m_zone_definition(zoneDefinition) { } -AssetCreationResult KeyValuePairsCreator::CreateAsset(const std::string& assetName, AssetCreationContext& context) +std::optional KeyValuePairsCompiler::GetHandlingAssetType() const +{ + return std::nullopt; +} + +AssetCreationResult KeyValuePairsCompiler::CreateAsset(const std::string& assetName, AssetCreationContext& context) { return AssetCreationResult::NoAction(); } -void KeyValuePairsCreator::FinalizeZone(AssetCreationContext& context) +void KeyValuePairsCompiler::FinalizeZone(AssetCreationContext& context) { std::vector kvpList; auto& memory = *m_zone.GetMemory(); diff --git a/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.h b/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.h similarity index 65% rename from src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.h rename to src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.h index f826110e..3ad22b8a 100644 --- a/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCreator.h +++ b/src/ObjCompiling/Game/T6/KeyValuePairs/KeyValuePairsCompiler.h @@ -6,11 +6,12 @@ namespace T6 { - class KeyValuePairsCreator : public AssetCreator + class KeyValuePairsCompiler final : public IAssetCreator { public: - KeyValuePairsCreator(const Zone& zone, const ZoneDefinition& zoneDefinition); + KeyValuePairsCompiler(const Zone& zone, const ZoneDefinition& zoneDefinition); + [[nodiscard]] std::optional GetHandlingAssetType() const override; AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override; void FinalizeZone(AssetCreationContext& context) override; diff --git a/src/ObjCompiling/Game/T6/ObjCompilerT6.cpp b/src/ObjCompiling/Game/T6/ObjCompilerT6.cpp index a63fbca3..f8dadf6a 100644 --- a/src/ObjCompiling/Game/T6/ObjCompilerT6.cpp +++ b/src/ObjCompiling/Game/T6/ObjCompilerT6.cpp @@ -3,6 +3,7 @@ #include "Game/T6/T6.h" #include "Image/ImageIPakPostProcessor.h" #include "Image/ImageIwdPostProcessor.h" +#include "KeyValuePairs/KeyValuePairsCompiler.h" #include @@ -11,11 +12,11 @@ namespace fs = std::filesystem; namespace { - void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath) + void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, const ZoneDefinitionContext& zoneDefinition, ISearchPath& searchPath) { auto& memory = *zone.GetMemory(); - // No compilers yet + collection.AddAssetCreator(std::make_unique(zone, zoneDefinition.m_zone_definition)); } void ConfigurePostProcessors( @@ -39,5 +40,6 @@ void ObjCompiler::ConfigureCreatorCollection(AssetCreatorCollection& collection, const fs::path& outDir, const fs::path& cacheDir) const { + ConfigureCompilers(collection, zone, zoneDefinition, searchPath); ConfigurePostProcessors(collection, zone, zoneDefinition, searchPath, outDir); }