mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-10 10:37:27 +00:00
refactor: only refer to game id in zone
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
#include "Zone.h"
|
||||
|
||||
Zone::Zone(std::string name, const zone_priority_t priority, IGame* game)
|
||||
#include "ZoneRegistry.h"
|
||||
|
||||
Zone::Zone(std::string name, const zone_priority_t priority, GameId gameId)
|
||||
: m_name(std::move(name)),
|
||||
m_priority(priority),
|
||||
m_language(GameLanguage::LANGUAGE_NONE),
|
||||
m_game(game),
|
||||
m_pools(ZoneAssetPools::CreateForGame(game->GetId(), this, priority)),
|
||||
m_memory(std::make_unique<ZoneMemory>()),
|
||||
m_registered(false)
|
||||
m_game_id(gameId),
|
||||
m_pools(ZoneAssetPools::CreateForGame(gameId, this, priority)),
|
||||
m_memory(std::make_unique<ZoneMemory>())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -15,7 +16,7 @@ Zone::~Zone()
|
||||
{
|
||||
if (m_registered)
|
||||
{
|
||||
m_game->RemoveZone(this);
|
||||
ZoneRegistry::GetRegistryForGame(m_game_id)->RemoveZone(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +24,7 @@ void Zone::Register()
|
||||
{
|
||||
if (!m_registered)
|
||||
{
|
||||
m_game->AddZone(this);
|
||||
ZoneRegistry::GetRegistryForGame(m_game_id)->AddZone(this);
|
||||
m_registered = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user