2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-13 21:51:42 +00:00

feat: accept aliases for asset type names

This commit is contained in:
Jan Laupetin
2026-05-02 17:42:55 +02:00
parent 0cbe0c2891
commit 08c128addd
20 changed files with 175 additions and 251 deletions
+7 -26
View File
@@ -83,6 +83,13 @@ namespace
namespace T6
{
Game::Game()
: AbstractGame(ASSET_TYPE_NAMES, std::extent_v<decltype(ASSET_TYPE_NAMES)>, SUB_ASSET_TYPE_NAMES, std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)>)
{
AddAssetTypeNameAlias<AssetTechniqueSet>("techset");
AddAssetTypeNameAlias<AssetLightDef>("gfxlightdef");
}
GameId Game::GetId() const
{
return GameId::T6;
@@ -123,30 +130,4 @@ namespace T6
return prefixes;
}
asset_type_t Game::GetAssetTypeCount() const
{
return ASSET_TYPE_COUNT;
}
std::optional<const char*> Game::GetAssetTypeName(const asset_type_t assetType) const
{
if (assetType < std::extent_v<decltype(ASSET_TYPE_NAMES)>)
return ASSET_TYPE_NAMES[assetType];
return std::nullopt;
}
asset_type_t Game::GetSubAssetTypeCount() const
{
return SUB_ASSET_TYPE_COUNT;
}
std::optional<const char*> Game::GetSubAssetTypeName(const asset_type_t subAssetType) const
{
if (subAssetType < std::extent_v<decltype(SUB_ASSET_TYPE_NAMES)>)
return SUB_ASSET_TYPE_NAMES[subAssetType];
return std::nullopt;
}
} // namespace T6