From 9f967b4d7a46f15ddc18218f48ffd7ad6dcedc09 Mon Sep 17 00:00:00 2001 From: Vadim Markovtsev Date: Sat, 29 Oct 2016 17:00:12 +0200 Subject: [PATCH] Fix formatting --- lib/CArtHandler.cpp | 5 ----- lib/CArtHandler.h | 2 +- lib/CCreatureSet.h | 5 +++-- lib/CGeneralTextHandler.cpp | 2 +- lib/CGeneralTextHandler.h | 19 +++++++++++-------- lib/NetPacksLib.cpp | 2 +- lib/mapObjects/CQuest.cpp | 8 ++++---- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index ad9941fb1..11ef44155 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -1348,11 +1348,6 @@ si32 CArtifactSet::getArtTypeId(ArtifactPosition pos) const return a->artType->id; } -CArtifactSet::~CArtifactSet() -{ - -} - ArtSlotInfo & CArtifactSet::retreiveNewArtSlot(ArtifactPosition slot) { assert(!vstd::contains(artifactsWorn, slot)); diff --git a/lib/CArtHandler.h b/lib/CArtHandler.h index 6e514f0dc..3492b5a5a 100644 --- a/lib/CArtHandler.h +++ b/lib/CArtHandler.h @@ -324,7 +324,7 @@ public: si32 getArtTypeId(ArtifactPosition pos) const; virtual ArtBearer::ArtBearer bearerType() const = 0; - virtual ~CArtifactSet(); + virtual ~CArtifactSet() = default; template void serialize(Handler &h, const int version) { diff --git a/lib/CCreatureSet.h b/lib/CCreatureSet.h index 9acec38a3..99fb252bf 100644 --- a/lib/CCreatureSet.h +++ b/lib/CCreatureSet.h @@ -30,6 +30,7 @@ public: CStackBasicDescriptor(); CStackBasicDescriptor(CreatureID id, TQuantity Count); CStackBasicDescriptor(const CCreature *c, TQuantity Count); + virtual ~CStackBasicDescriptor() = default; template void serialize(Handler &h, const int version) { @@ -84,7 +85,7 @@ public: CStackInstance(); CStackInstance(CreatureID id, TQuantity count); CStackInstance(const CCreature *cre, TQuantity count); - ~CStackInstance(); + virtual ~CStackInstance(); void setType(CreatureID creID); void setType(const CCreature *c); @@ -111,7 +112,7 @@ public: void init() override; CCommanderInstance(); CCommanderInstance (CreatureID id); - ~CCommanderInstance(); + virtual ~CCommanderInstance(); void setAlive (bool alive); void giveStackExp (TExpType exp) override; void levelUp (); diff --git a/lib/CGeneralTextHandler.cpp b/lib/CGeneralTextHandler.cpp index 196ce5208..734f1e62e 100644 --- a/lib/CGeneralTextHandler.cpp +++ b/lib/CGeneralTextHandler.cpp @@ -298,7 +298,7 @@ bool CLegacyConfigParser::endLine() return curr < end; } -void CGeneralTextHandler::readToVector(std::string sourceName, std::vector & dest) +void CGeneralTextHandler::readToVector(std::string sourceName, std::vector &dest) { CLegacyConfigParser parser(sourceName); do diff --git a/lib/CGeneralTextHandler.h b/lib/CGeneralTextHandler.h index bc04c3afc..a0debd1b2 100644 --- a/lib/CGeneralTextHandler.h +++ b/lib/CGeneralTextHandler.h @@ -111,7 +111,7 @@ public: std::vector tavernInfo; std::vector tavernRumors; - std::vector > zelp; + std::vector> zelp; std::vector lossCondtions; std::vector victoryConditions; @@ -123,23 +123,26 @@ public: std::vector restypes; //names of resources std::vector terrainNames; std::vector randsign; - std::vector > mines; //first - name; second - event description + std::vector> mines; //first - name; second - event description std::vector seerEmpty; - std::vector > > quests; //[quest][type][index] + std::vector>> quests; //[quest][type][index] //type: quest, progress, complete, rollover, log OR time limit //index: 0-2 seer hut, 3-5 border guard std::vector seerNames; std::vector tentColors; //sec skills - std::vector skillName; - std::vector > skillInfoTexts; //[id][level] : level 0 - basic; 2 - advanced + std::vector skillName; + std::vector> skillInfoTexts; //[id][level] : level 0 - basic; 2 - advanced std::vector levels; std::vector zcrexp; //more or less useful content of that file //campaigns - std::vector campaignMapNames; - std::vector < std::vector > campaignRegionNames; + std::vector campaignMapNames; + std::vector> campaignRegionNames; + + static void readToVector(std::string sourceName, std::vector &dest); - void readToVector(std::string sourceName, std::vector & dest); CGeneralTextHandler(); + CGeneralTextHandler(const CGeneralTextHandler&) = delete; + CGeneralTextHandler operator=(const CGeneralTextHandler&) = delete; }; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 4caa34790..054b26d2c 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -122,7 +122,7 @@ DLL_LINKAGE void SetCommanderProperty::applyGs(CGameState *gs) commander->setAlive(false); break; case EXPERIENCE: - commander->giveStackExp (amount); //TODO: allow setting exp for stacks via netpacks + commander->giveStackExp(amount); //TODO: allow setting exp for stacks via netpacks break; } } diff --git a/lib/mapObjects/CQuest.cpp b/lib/mapObjects/CQuest.cpp index 4db528674..6fe62eed6 100644 --- a/lib/mapObjects/CQuest.cpp +++ b/lib/mapObjects/CQuest.cpp @@ -137,7 +137,7 @@ void CQuest::getVisitText(MetaString &iwText, std::vector &components switch (missionType) { case MISSION_LEVEL: - components.push_back(Component (Component::EXPERIENCE, 0, m13489val, 0)); + components.push_back(Component(Component::EXPERIENCE, 0, m13489val, 0)); if(!isCustom) iwText.addReplacement(m13489val); break; @@ -148,7 +148,7 @@ void CQuest::getVisitText(MetaString &iwText, std::vector &components { if(m2stats[i]) { - components.push_back(Component (Component::PRIM_SKILL, i, m2stats[i], 0)); + components.push_back(Component(Component::PRIM_SKILL, i, m2stats[i], 0)); loot << "%d %s"; loot.addReplacement(m2stats[i]); loot.addReplacement(VLC->generaltexth->primarySkillNames[i]); @@ -165,7 +165,7 @@ void CQuest::getVisitText(MetaString &iwText, std::vector &components break; case MISSION_HERO: //FIXME: portrait may not match hero, if custom portrait was set in map editor - components.push_back(Component (Component::HERO_PORTRAIT, VLC->heroh->heroes[m13489val]->imageIndex, 0, 0)); + components.push_back(Component(Component::HERO_PORTRAIT, VLC->heroh->heroes[m13489val]->imageIndex, 0, 0)); if(!isCustom) iwText.addReplacement(VLC->heroh->heroes[m13489val]->name); break; @@ -183,7 +183,7 @@ void CQuest::getVisitText(MetaString &iwText, std::vector &components MetaString loot; for(auto & elem : m5arts) { - components.push_back(Component (Component::ARTIFACT, elem, 0, 0)); + components.push_back(Component(Component::ARTIFACT, elem, 0, 0)); loot << "%s"; loot.addReplacement(MetaString::ART_NAMES, elem); }