mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-27 16:46:56 +00:00
refactor: only refer to game id in zone
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "GameLanguage.h"
|
||||
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
class Zone;
|
||||
|
||||
enum class GameId
|
||||
{
|
||||
IW3,
|
||||
@@ -39,9 +38,6 @@ public:
|
||||
[[nodiscard]] virtual GameId GetId() const = 0;
|
||||
[[nodiscard]] virtual const std::string& GetFullName() const = 0;
|
||||
[[nodiscard]] virtual const std::string& GetShortName() const = 0;
|
||||
virtual void AddZone(Zone* zone) = 0;
|
||||
virtual void RemoveZone(Zone* zone) = 0;
|
||||
[[nodiscard]] virtual const std::vector<Zone*>& GetZones() const = 0;
|
||||
[[nodiscard]] virtual const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const = 0;
|
||||
|
||||
static IGame* GetGameById(GameId gameId);
|
||||
|
||||
@@ -21,24 +21,6 @@ const std::string& Game::GetShortName() const
|
||||
return shortName;
|
||||
}
|
||||
|
||||
void Game::AddZone(Zone* zone)
|
||||
{
|
||||
m_zones.push_back(zone);
|
||||
}
|
||||
|
||||
void Game::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
}
|
||||
|
||||
const std::vector<Zone*>& Game::GetZones() const
|
||||
{
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
|
||||
@@ -9,12 +9,6 @@ namespace IW3
|
||||
[[nodiscard]] GameId GetId() const override;
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
void AddZone(Zone* zone) override;
|
||||
void RemoveZone(Zone* zone) override;
|
||||
[[nodiscard]] const std::vector<Zone*>& GetZones() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
private:
|
||||
std::vector<Zone*> m_zones;
|
||||
};
|
||||
} // namespace IW3
|
||||
|
||||
@@ -21,24 +21,6 @@ const std::string& Game::GetShortName() const
|
||||
return shortName;
|
||||
}
|
||||
|
||||
void Game::AddZone(Zone* zone)
|
||||
{
|
||||
m_zones.push_back(zone);
|
||||
}
|
||||
|
||||
void Game::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
}
|
||||
|
||||
const std::vector<Zone*>& Game::GetZones() const
|
||||
{
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
|
||||
@@ -9,12 +9,6 @@ namespace IW4
|
||||
[[nodiscard]] GameId GetId() const override;
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
void AddZone(Zone* zone) override;
|
||||
void RemoveZone(Zone* zone) override;
|
||||
[[nodiscard]] const std::vector<Zone*>& GetZones() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
private:
|
||||
std::vector<Zone*> m_zones;
|
||||
};
|
||||
} // namespace IW4
|
||||
|
||||
@@ -21,24 +21,6 @@ const std::string& Game::GetShortName() const
|
||||
return shortName;
|
||||
}
|
||||
|
||||
void Game::AddZone(Zone* zone)
|
||||
{
|
||||
m_zones.push_back(zone);
|
||||
}
|
||||
|
||||
void Game::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
}
|
||||
|
||||
const std::vector<Zone*>& Game::GetZones() const
|
||||
{
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes;
|
||||
|
||||
@@ -9,12 +9,6 @@ namespace IW5
|
||||
[[nodiscard]] GameId GetId() const override;
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
void AddZone(Zone* zone) override;
|
||||
void RemoveZone(Zone* zone) override;
|
||||
[[nodiscard]] const std::vector<Zone*>& GetZones() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
private:
|
||||
std::vector<Zone*> m_zones;
|
||||
};
|
||||
} // namespace IW5
|
||||
|
||||
@@ -21,24 +21,6 @@ const std::string& Game::GetShortName() const
|
||||
return shortName;
|
||||
}
|
||||
|
||||
void Game::AddZone(Zone* zone)
|
||||
{
|
||||
m_zones.push_back(zone);
|
||||
}
|
||||
|
||||
void Game::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
}
|
||||
|
||||
const std::vector<Zone*>& Game::GetZones() const
|
||||
{
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
|
||||
@@ -9,12 +9,6 @@ namespace T5
|
||||
[[nodiscard]] GameId GetId() const override;
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
void AddZone(Zone* zone) override;
|
||||
void RemoveZone(Zone* zone) override;
|
||||
[[nodiscard]] const std::vector<Zone*>& GetZones() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
private:
|
||||
std::vector<Zone*> m_zones;
|
||||
};
|
||||
} // namespace T5
|
||||
|
||||
@@ -21,24 +21,6 @@ const std::string& Game::GetShortName() const
|
||||
return shortName;
|
||||
}
|
||||
|
||||
void Game::AddZone(Zone* zone)
|
||||
{
|
||||
m_zones.push_back(zone);
|
||||
}
|
||||
|
||||
void Game::RemoveZone(Zone* zone)
|
||||
{
|
||||
const auto foundEntry = std::ranges::find(m_zones, zone);
|
||||
|
||||
if (foundEntry != m_zones.end())
|
||||
m_zones.erase(foundEntry);
|
||||
}
|
||||
|
||||
const std::vector<Zone*>& Game::GetZones() const
|
||||
{
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
const std::vector<GameLanguagePrefix>& Game::GetLanguagePrefixes() const
|
||||
{
|
||||
static std::vector<GameLanguagePrefix> prefixes{
|
||||
|
||||
@@ -9,12 +9,6 @@ namespace T6
|
||||
[[nodiscard]] GameId GetId() const override;
|
||||
[[nodiscard]] const std::string& GetFullName() const override;
|
||||
[[nodiscard]] const std::string& GetShortName() const override;
|
||||
void AddZone(Zone* zone) override;
|
||||
void RemoveZone(Zone* zone) override;
|
||||
[[nodiscard]] const std::vector<Zone*>& GetZones() const override;
|
||||
[[nodiscard]] const std::vector<GameLanguagePrefix>& GetLanguagePrefixes() const override;
|
||||
|
||||
private:
|
||||
std::vector<Zone*> m_zones;
|
||||
};
|
||||
} // namespace T6
|
||||
|
||||
Reference in New Issue
Block a user