refactor: moved TowerInfo class

This commit is contained in:
2021-09-19 18:25:37 +02:00
parent 3771ea4a27
commit 13c8303c90
5 changed files with 40 additions and 54 deletions

View File

@@ -1,6 +1,8 @@
#pragma once
#include <cstdint>
#include <string>
#include "misc/Time.h"
namespace td {
@@ -98,6 +100,22 @@ public: // conve
};
class TowerInfo {
private:
std::string m_Name, m_Description;
bool m_IsBigTower;
public:
TowerInfo(std::string&& name, std::string&& description, bool big) : m_Name(std::move(name)),
m_Description(std::move(description)), m_IsBigTower(big) {}
const std::string& getName() const { return m_Name; }
const std::string& getDescription() const { return m_Description; }
bool isBigTower() const { return m_IsBigTower; }
};
const TowerInfo& getTowerInfo(TowerType type);
// ---------- Little Towers ----------
class LittleTower : public Tower {

View File

@@ -1,26 +0,0 @@
#pragma once
#include "game/Towers.h"
#include <string>
namespace td {
namespace game {
class TowerInfo {
private:
std::string m_Name, m_Description;
bool m_IsBigTower;
public:
TowerInfo(std::string&& name, std::string&& description, bool big) : m_Name(std::move(name)),
m_Description(std::move(description)), m_IsBigTower(big) {}
const std::string& getName() const { return m_Name; }
const std::string& getDescription() const { return m_Description; }
bool isBigTower() const { return m_IsBigTower; }
};
const TowerInfo& getTowerInfo(TowerType type);
} // namespace game
} // namespace td