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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user