2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-04-29 15:09:38 +00:00

refactor: do not nest asset namespaces in game namespaces

* Duplicated namespace names are kind of annoying
This commit is contained in:
Jan Laupetin
2025-08-06 00:50:35 +02:00
parent 33c09dfe61
commit 46fb919a52
336 changed files with 1430 additions and 1480 deletions
@@ -40,14 +40,14 @@ namespace
private:
IGdtQueryable& m_gdt;
T6::vehicle::InfoStringLoader m_info_string_loader;
vehicle::InfoStringLoaderT6 m_info_string_loader;
};
} // namespace
namespace T6::vehicle
namespace vehicle
{
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone)
{
return std::make_unique<GdtLoaderVehicle>(memory, searchPath, gdt, zone);
}
} // namespace T6::vehicle
} // namespace vehicle
@@ -8,7 +8,7 @@
#include <memory>
namespace T6::vehicle
namespace vehicle
{
std::unique_ptr<AssetCreator<AssetVehicle>> CreateGdtLoader(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
} // namespace T6::vehicle
std::unique_ptr<AssetCreator<T6::AssetVehicle>> CreateGdtLoaderT6(MemoryManager& memory, ISearchPath& searchPath, IGdtQueryable& gdt, Zone& zone);
} // namespace vehicle
@@ -107,16 +107,16 @@ namespace
};
} // namespace
namespace T6::vehicle
namespace vehicle
{
InfoStringLoader::InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
InfoStringLoaderT6::InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
: m_memory(memory),
m_search_path(searchPath),
m_zone(zone)
{
}
AssetCreationResult InfoStringLoader::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
AssetCreationResult InfoStringLoaderT6::CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context)
{
auto* vehicleDef = m_memory.Alloc<VehicleDef>();
vehicleDef->name = m_memory.Dup(assetName.c_str());
@@ -133,4 +133,4 @@ namespace T6::vehicle
return AssetCreationResult::Success(context.AddAsset(std::move(registration)));
}
} // namespace T6::vehicle
} // namespace vehicle
@@ -4,12 +4,12 @@
#include "Asset/AssetCreationResult.h"
#include "InfoString/InfoString.h"
namespace T6::vehicle
namespace vehicle
{
class InfoStringLoader
class InfoStringLoaderT6
{
public:
InfoStringLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
InfoStringLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
AssetCreationResult CreateAsset(const std::string& assetName, const InfoString& infoString, AssetCreationContext& context);
@@ -18,4 +18,4 @@ namespace T6::vehicle
ISearchPath& m_search_path;
Zone& m_zone;
};
} // namespace T6::vehicle
} // namespace vehicle
@@ -11,7 +11,6 @@
#include <iostream>
using namespace T6;
using namespace ::vehicle;
namespace
{
@@ -26,7 +25,7 @@ namespace
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
{
const auto fileName = GetFileNameForAssetName(assetName);
const auto fileName = vehicle::GetFileNameForAssetName(assetName);
const auto file = m_search_path.Open(fileName);
if (!file.IsOpen())
return AssetCreationResult::NoAction();
@@ -43,14 +42,14 @@ namespace
private:
ISearchPath& m_search_path;
T6::vehicle::InfoStringLoader m_info_string_loader;
vehicle::InfoStringLoaderT6 m_info_string_loader;
};
} // namespace
namespace T6::vehicle
namespace vehicle
{
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
{
return std::make_unique<RawLoaderVehicle>(memory, searchPath, zone);
}
} // namespace T6::vehicle
} // namespace vehicle
@@ -7,7 +7,7 @@
#include <memory>
namespace T6::vehicle
namespace vehicle
{
std::unique_ptr<AssetCreator<AssetVehicle>> CreateRawLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
} // namespace T6::vehicle
std::unique_ptr<AssetCreator<T6::AssetVehicle>> CreateRawLoaderT6(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
} // namespace vehicle