ZoneLoading: Add ZoneMemory and the possibility to unload zones and their memory

This commit is contained in:
Jan
2019-12-24 18:41:42 +01:00
parent d224eb8ce5
commit 7121f2e215
9 changed files with 116 additions and 2 deletions

View File

@ -8,5 +8,6 @@ class IGame
{
public:
virtual void AddZone(Zone* zone) = 0;
virtual void RemoveZone(Zone* zone) = 0;
virtual std::vector<Zone*> GetZones() = 0;
};

View File

@ -10,6 +10,14 @@ void GameT6::AddZone(Zone* zone)
m_zones.push_back(zone);
}
void GameT6::RemoveZone(Zone* zone)
{
const auto foundEntry = std::find(m_zones.begin(), m_zones.end(), zone);
if (foundEntry != m_zones.end())
m_zones.erase(foundEntry);
}
std::vector<Zone*> GameT6::GetZones()
{
return m_zones;

View File

@ -7,6 +7,7 @@ class GameT6 : public IGame
public:
void AddZone(Zone* zone) override;
void RemoveZone(Zone* zone) override;
std::vector<Zone*> GetZones() override;
};