mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-02-14 03:13:03 +00:00
refactor: retrieve asset names from IGame
This commit is contained in:
@@ -1,28 +1,56 @@
|
||||
#include "GameIW3.h"
|
||||
|
||||
#include "IW3.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
GameId Game::GetId() const
|
||||
namespace
|
||||
{
|
||||
return GameId::IW3;
|
||||
}
|
||||
constexpr const char* ASSET_TYPE_NAMES[ASSET_TYPE_COUNT]{
|
||||
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
|
||||
"clipmap_unused", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable",
|
||||
};
|
||||
} // namespace
|
||||
|
||||
const std::string& Game::GetFullName() const
|
||||
namespace IW3
|
||||
{
|
||||
static std::string fullName = "Call Of Duty 4: Modern Warfare";
|
||||
return fullName;
|
||||
}
|
||||
GameId Game::GetId() const
|
||||
{
|
||||
return GameId::IW3;
|
||||
}
|
||||
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW3";
|
||||
return shortName;
|
||||
}
|
||||
const std::string& Game::GetFullName() const
|
||||
{
|
||||
static std::string fullName = "Call Of Duty 4: Modern Warfare";
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
return prefixes;
|
||||
}
|
||||
const std::string& Game::GetShortName() const
|
||||
{
|
||||
static std::string shortName = "IW3";
|
||||
return shortName;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
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;
|
||||
}
|
||||
} // namespace IW3
|
||||
|
||||
Reference in New Issue
Block a user