From ef05a56e493e0e8201f5bb719027d5adf44df3a5 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Tue, 30 Aug 2016 05:13:45 +0300 Subject: [PATCH] cleanup --- client/Client.h | 14 +++++++------- client/widgets/MiscWidgets.h | 2 +- lib/CGameInterface.h | 4 ++-- lib/NetPacks.h | 30 ++++++++++++++--------------- lib/spells/CDefaultSpellMechanics.h | 4 +--- lib/spells/CSpellHandler.h | 2 +- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/client/Client.h b/client/Client.h index e713e8984..920638a00 100644 --- a/client/Client.h +++ b/client/Client.h @@ -16,7 +16,7 @@ * */ -class CPack; +struct CPack; class CCampaignState; class CBattleCallback; class IGameEventsReceiver; @@ -175,9 +175,9 @@ public: void setBlockVis(ObjectInstanceID objid, bool bv) override {}; void setOwner(const CGObjectInstance * obj, PlayerColor owner) override {}; void changePrimSkill(const CGHeroInstance * hero, PrimarySkill::PrimarySkill which, si64 val, bool abs=false) override {}; - void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override {}; + void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override {}; - void showBlockingDialog(BlockingDialog *iw) override {}; + void showBlockingDialog(BlockingDialog *iw) override {}; void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {}; void showTeleportDialog(TeleportDialog *iw) override {}; void showThievesGuildWindow(PlayerColor player, ObjectInstanceID requestingObjId) override {}; @@ -194,12 +194,12 @@ public: bool addToSlot(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;} void tryJoiningArmy(const CArmedInstance *src, const CArmedInstance *dst, bool removeObjWhenFinished, bool allowMerging) override {} bool moveStack(const StackLocation &src, const StackLocation &dst, TQuantity count = -1) override {return false;} - + void removeAfterVisit(const CGObjectInstance *object) override {}; void giveHeroNewArtifact(const CGHeroInstance *h, const CArtifact *artType, ArtifactPosition pos) override {}; void giveHeroArtifact(const CGHeroInstance *h, const CArtifactInstance *a, ArtifactPosition pos) override {}; - void putArtifact(const ArtifactLocation &al, const CArtifactInstance *a) override {}; + void putArtifact(const ArtifactLocation &al, const CArtifactInstance *a) override {}; void removeArtifact(const ArtifactLocation &al) override {}; bool moveArtifact(const ArtifactLocation &al1, const ArtifactLocation &al2) override {return false;}; void synchronizeArtifactHandlerLists() override {}; @@ -207,7 +207,7 @@ public: void showCompInfo(ShowInInfobox * comp) override {}; void heroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero) override {}; void stopHeroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero) override {}; - //void giveHeroArtifact(int artid, int hid, int position){}; + //void giveHeroArtifact(int artid, int hid, int position){}; //void giveNewArtifact(int hid, int position){}; void startBattlePrimary(const CArmedInstance *army1, const CArmedInstance *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool creatureBank = false, const CGTownInstance *town = nullptr) override {}; //use hero=nullptr for no hero void startBattleI(const CArmedInstance *army1, const CArmedInstance *army2, int3 tile, bool creatureBank = false) override {}; //if any of armies is hero, hero will be used @@ -241,7 +241,7 @@ public: void serialize(COSer &h, const int version); void serialize(CISer &h, const int version); - + void serialize(COSer &h, const int version, const std::set& playerIDs); void serialize(CISer &h, const int version, const std::set& playerIDs); void battleFinished(); diff --git a/client/widgets/MiscWidgets.h b/client/widgets/MiscWidgets.h index 42eb4f8da..94f4e8d98 100644 --- a/client/widgets/MiscWidgets.h +++ b/client/widgets/MiscWidgets.h @@ -17,7 +17,7 @@ class CCreatureAnim; class CComponent; class CGGarrison; class CSelectableComponent; -class InfoAboutArmy; +struct InfoAboutArmy; class CArmedInstance; class IBonusBearer; class CAnimImage; diff --git a/lib/CGameInterface.h b/lib/CGameInterface.h index d3f5e513a..b91ab018d 100644 --- a/lib/CGameInterface.h +++ b/lib/CGameInterface.h @@ -50,7 +50,7 @@ struct StackLocation; class CStackInstance; class CCommanderInstance; class CStack; -class CPathsInfo; +struct CPathsInfo; class CCreature; class CLoadFile; class CSaveFile; @@ -98,7 +98,7 @@ public: virtual void showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID) = 0; virtual void showTeleportDialog(TeleportChannelID channel, TTeleportExitsList exits, bool impassable, QueryID askID) = 0; virtual void finish(){}; //if for some reason we want to end - + virtual void showWorldViewEx(const std::vector & objectPositions){}; }; diff --git a/lib/NetPacks.h b/lib/NetPacks.h index eaec28181..58d9b34bb 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -42,7 +42,7 @@ struct StackLocation; struct ArtSlotInfo; struct QuestInfo; class CMapInfo; -class StartInfo; +struct StartInfo; struct CPackForClient : public CPack @@ -149,7 +149,7 @@ struct PlayerBlocked : public CPackForClient //96 enum EReason { UPCOMING_BATTLE, ONGOING_MOVEMENT }; enum EMode { BLOCKADE_STARTED, BLOCKADE_ENDED }; - + EReason reason; EMode startOrEnd; PlayerColor player; @@ -1020,7 +1020,7 @@ namespace ObjProperty { enum {OWNER = 1, BLOCKVIS = 2, PRIMARY_STACK_COUNT = 3, VISITORS = 4, VISITED = 5, ID = 6, AVAILABLE_CREATURE = 7, SUBID = 8, MONSTER_COUNT = 10, MONSTER_POWER = 11, MONSTER_EXP = 12, MONSTER_RESTORE_TYPE = 13, MONSTER_REFUSED_JOIN, - + //town-specific STRUCTURE_ADD_VISITING_HERO, STRUCTURE_CLEAR_VISITORS, STRUCTURE_ADD_GARRISONED_HERO, //changing buildings state BONUS_VALUE_FIRST, BONUS_VALUE_SECOND, //used in Rampart for special building that generates resources (storing resource type and quantity) @@ -1409,8 +1409,8 @@ struct BattleAttack : public CPackForClient//3006 ui32 stackAttacking; ui32 flags; //uses Eflags (below) enum EFlags{SHOT = 1, COUNTER = 2, LUCKY = 4, UNLUCKY = 8, BALLISTA_DOUBLE_DMG = 16, DEATH_BLOW = 32, SPELL_LIKE = 64}; - - SpellID spellID; //for SPELL_LIKE + + SpellID spellID; //for SPELL_LIKE bool shot() const//distance attack - decrease number of shots { @@ -1480,12 +1480,12 @@ struct BattleSpellCast : public CPackForClient//3009 struct CustomEffect { /// WoG AC format - ui32 effect; + ui32 effect; ui32 stack; template void serialize(Handler &h, const int version) { h & effect & stack; - } + } }; BattleSpellCast(){type = 3009; casterStack = -1;}; @@ -1625,9 +1625,9 @@ struct BattleStackAdded : public CPackForClient //3017 int amount; int pos; int summoned; //if true, remove it afterwards - + ///Actual stack ID, set on apply, do not serialize - int newStackID; + int newStackID; template void serialize(Handler &h, const int version) { @@ -1735,17 +1735,17 @@ struct AdvmapSpellCast : public CPackForClient //108 struct ShowWorldViewEx : public CPackForClient //4000 { PlayerColor player; - + std::vector objectPositions; - + ShowWorldViewEx(){type = 4000;} - + void applyCl(CClient *cl); - + template void serialize(Handler &h, const int version) { h & player & objectPositions; - } + } }; /***********************************************************************************************************/ @@ -2231,7 +2231,7 @@ struct ELF_VISIBILITY UpdateStartOptions : public CPregamePackToPropagate struct PregameGuiAction : public CPregamePackToPropagate { - enum {NO_TAB, OPEN_OPTIONS, OPEN_SCENARIO_LIST, OPEN_RANDOM_MAP_OPTIONS} + enum {NO_TAB, OPEN_OPTIONS, OPEN_SCENARIO_LIST, OPEN_RANDOM_MAP_OPTIONS} action; void apply(CSelectionScreen *selScreen); //that functions are implemented in CPreGame.cpp diff --git a/lib/spells/CDefaultSpellMechanics.h b/lib/spells/CDefaultSpellMechanics.h index 40cc0ab95..910d25fd9 100644 --- a/lib/spells/CDefaultSpellMechanics.h +++ b/lib/spells/CDefaultSpellMechanics.h @@ -12,9 +12,7 @@ #include "ISpellMechanics.h" -class ISpellMechanics; -class BattleSpellCast; -class StacksInjured; +struct StacksInjured; struct SpellCastContext { diff --git a/lib/spells/CSpellHandler.h b/lib/spells/CSpellHandler.h index 480d3ea59..01d798f9c 100644 --- a/lib/spells/CSpellHandler.h +++ b/lib/spells/CSpellHandler.h @@ -24,7 +24,7 @@ class CLegacyConfigParser; class CGHeroInstance; class CStack; class CBattleInfoCallback; -class BattleInfo; +struct BattleInfo; struct CPackForClient; struct BattleSpellCast; class CGameInfoCallback;