Restructure ZoneDefinitionWriting

This commit is contained in:
Jan
2021-03-08 17:28:24 +01:00
parent e6a91c0305
commit d96f813e73
18 changed files with 285 additions and 221 deletions

View File

@ -1,13 +1,21 @@
#pragma once
#include "GameLanguage.h"
#include <vector>
#include "GameLanguage.h"
class Zone;
class IGame
{
public:
virtual const std::string& GetName() = 0;
IGame() = default;
virtual ~IGame() = default;
IGame(const IGame& other) = default;
IGame(IGame&& other) noexcept = default;
IGame& operator=(const IGame& other) = default;
IGame& operator=(IGame&& other) noexcept = default;
virtual std::string GetFullName() = 0;
virtual std::string GetShortName() = 0;
virtual void AddZone(Zone* zone) = 0;
virtual void RemoveZone(Zone* zone) = 0;
virtual std::vector<Zone*> GetZones() = 0;

View File

@ -8,11 +8,14 @@ using namespace IW4;
GameIW4 g_GameIW4;
const std::string GameIW4::NAME = "IW4";
const std::string& GameIW4::GetName()
std::string GameIW4::GetFullName()
{
return NAME;
return "Call Of Duty: Modern Warfare 2";
}
std::string GameIW4::GetShortName()
{
return "IW4";
}
void GameIW4::AddZone(Zone* zone)

View File

@ -3,11 +3,11 @@
class GameIW4 : public IGame
{
static const std::string NAME;
std::vector<Zone*> m_zones;
public:
const std::string& GetName() override;
std::string GetFullName() override;
std::string GetShortName() override;
void AddZone(Zone* zone) override;
void RemoveZone(Zone* zone) override;
std::vector<Zone*> GetZones() override;

View File

@ -8,11 +8,14 @@ using namespace T6;
GameT6 g_GameT6;
const std::string GameT6::NAME = "T6";
const std::string& GameT6::GetName()
std::string GameT6::GetFullName()
{
return NAME;
return "Call Of Duty: Black Ops II";
}
std::string GameT6::GetShortName()
{
return "T6";
}
void GameT6::AddZone(Zone* zone)

View File

@ -3,11 +3,11 @@
class GameT6 : public IGame
{
static const std::string NAME;
std::vector<Zone*> m_zones;
public:
const std::string& GetName() override;
std::string GetFullName() override;
std::string GetShortName() override;
void AddZone(Zone* zone) override;
void RemoveZone(Zone* zone) override;
std::vector<Zone*> GetZones() override;