refactor: format project

This commit is contained in:
2021-11-21 17:02:42 +01:00
parent 0f328e6f81
commit f48af51dc7
36 changed files with 162 additions and 162 deletions

View File

@@ -61,7 +61,7 @@ public:
std::uint16_t getMaxLife() const { return m_MaxLife; }
};
struct EffectDuration{
struct EffectDuration {
EffectType type;
float duration; // in seconds
const Tower* tower; // the tower that gived the effect
@@ -88,7 +88,7 @@ private:
float m_X = 0, m_Y = 0;
public:
Mob(MobID id, MobLevel level, PlayerID sender) : m_Sender(sender), m_Level(level),
Mob(MobID id, MobLevel level, PlayerID sender) : m_Sender(sender), m_Level(level),
m_EffectFireTimer(1000), m_EffectPoisonTimer(1000), m_EffectHealTimer(1000) {
}
@@ -97,7 +97,7 @@ public:
virtual void tick(std::uint64_t delta);
virtual void OnDeath(World* world){}
virtual void OnDeath(World* world) {}
const TowerImmunities& getTowerImmunities() const { return getMobTowerImmunities(getType(), m_Level); }
const EffectImmunities& getEffectImmunities() const { return getMobEffectImmunities(getType(), m_Level); }

View File

@@ -22,7 +22,7 @@ private:
bool m_GoldChanged;
bool m_ExpChanged;
public:
Player(std::uint8_t id = 0) : m_TeamColor(game::TeamColor::None), m_Gold(0), m_Exp(0), m_ID(id), m_GoldPerSecond(5),
Player(std::uint8_t id = 0) : m_TeamColor(game::TeamColor::None), m_Gold(0), m_Exp(0), m_ID(id), m_GoldPerSecond(5),
m_GoldChanged(false), m_ExpChanged(false) {}
const std::string& getName() const { return m_Name; }
@@ -34,7 +34,7 @@ public:
std::uint8_t getGoldPerSecond() const { return m_GoldPerSecond; }
void setGoldPerSecond(std::uint8_t goldPerSecond) { m_GoldPerSecond = goldPerSecond; }
std::uint32_t getGold() const { return m_Gold;}
std::uint32_t getGold() const { return m_Gold; }
void setGold(std::uint32_t gold) { m_GoldChanged = true; m_Gold = gold; }
void addGold(std::uint32_t gold) { m_GoldChanged = true; m_Gold += gold; }
void removeGold(std::uint32_t gold) { m_GoldChanged = true; m_Gold -= gold; }

View File

@@ -18,7 +18,7 @@ enum class Architecture {
Unknown,
};
inline Os getSystemOs(){
inline Os getSystemOs() {
#if defined(_WIN32) || defined(_WIN64)
return Os::Windows;
#elif defined(__ANDROID__)
@@ -26,12 +26,12 @@ inline Os getSystemOs(){
#elif defined(__unix__)
return Os::Linux;
#else
#pragma message ("Target OS unknown or unsupported !")
#pragma message ("Target OS unknown or unsupported !")
return Os::Unknown;
#endif
}
inline Architecture getSystemArchitecture(){
inline Architecture getSystemArchitecture() {
#if defined(_WIN64)
return Architecture::x86_64;
#elif defined(_WIN32)
@@ -45,7 +45,7 @@ inline Architecture getSystemArchitecture(){
#elif defined(__arm__) || defined(_M_ARM)
return Architecture::Armhf;
#else
#pragma message ("Target CPU architecture unknown or unsupported !")
#pragma message ("Target CPU architecture unknown or unsupported !")
return Architecture::Unknown;
#endif
}

View File

@@ -6,7 +6,7 @@ namespace td {
namespace utils {
template<typename NumberType>
NumberType getRandomInt(NumberType min, NumberType max){
NumberType getRandomInt(NumberType min, NumberType max) {
std::random_device randomDevice;
std::mt19937 generator(randomDevice());
std::uniform_int_distribution<NumberType> distrib(min, max);
@@ -14,7 +14,7 @@ NumberType getRandomInt(NumberType min, NumberType max){
}
template<typename NumberType>
NumberType getRandomReal(NumberType min, NumberType max){
NumberType getRandomReal(NumberType min, NumberType max) {
std::random_device randomDevice;
std::mt19937 generator(randomDevice());
std::uniform_real_distribution<NumberType> distrib(min, max);

View File

@@ -64,7 +64,7 @@ public:
bool update(std::uint64_t delta);
void applyCooldown();
void applyCooldown();
void reset();

View File

@@ -30,11 +30,11 @@ public:
float getDownloadProgress() { return m_Progress; }
bool isDownloadComplete() { return m_DownloadComplete; }
bool isFileWrited() { return m_FileWrited; }
static std::string getLocalFilePath();
static void removeOldFile();
static std::string getCurrentVersion(){ return TD_VERSION; }
static std::string getCurrentVersion() { return TD_VERSION; }
std::string getLastVersion() { return m_LastVersion; }
bool canUpdate();

View File

@@ -37,7 +37,7 @@ private:
float m_CamSensibility = 1;
bool m_PopupOpened = false;
VertexCache m_TowersCache;
std::unique_ptr<gui::TowerPlacePopup> m_TowerPlacePopup;
std::unique_ptr<gui::MobTooltip> m_MobTooltip;
public:

View File

@@ -12,13 +12,13 @@ class GuiManager {
private:
std::vector<std::shared_ptr<GuiWidget>> m_Widgets;
public:
void renderWidgets(){
for(auto widget : m_Widgets){
void renderWidgets() {
for (auto widget : m_Widgets) {
widget->render();
}
}
void addWidgets(const std::shared_ptr<GuiWidget>& widget){
void addWidgets(const std::shared_ptr<GuiWidget>& widget) {
m_Widgets.push_back(std::move(widget));
}
};

View File

@@ -7,7 +7,7 @@ namespace td {
namespace game {
class Mob;
} // namespace game
namespace gui {

View File

@@ -8,7 +8,7 @@
namespace td {
namespace gui {
class SummonMenu : public GuiWidget{
class SummonMenu : public GuiWidget {
private:
bool m_MenuOpened;
int m_ImageWidth = 100;

View File

@@ -10,7 +10,7 @@
#include <memory>
struct SDL_Window;
typedef void *SDL_GLContext;
typedef void* SDL_GLContext;
namespace td {
@@ -26,7 +26,7 @@ class MainMenu;
class GameMenu;
class FrameMenu;
class UpdateMenu;
} // namespace gui
namespace render {