1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #122 from vmarkovtsev/feature/warnings

Fix warnings produced by recent Clang build
This commit is contained in:
Alexander Shishkin 2015-10-14 07:28:47 +03:00
commit fca4deaad2
59 changed files with 438 additions and 438 deletions

View File

@ -432,7 +432,7 @@ bool boundaryBetweenTwoPoints (int3 pos1, int3 pos2, CCallback * cbp) //determin
for (int y = yMin; y <= yMax; ++y) for (int y = yMin; y <= yMax; ++y)
{ {
int3 tile = int3(x, y, pos1.z); //use only on same level, ofc int3 tile = int3(x, y, pos1.z); //use only on same level, ofc
if (abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5) if (std::abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5)
{ {
if (!(cbp->isVisible(tile) && cbp->getTile(tile)->blocked)) //if there's invisible or unblocked tile between, it's good if (!(cbp->isVisible(tile) && cbp->getTile(tile)->blocked)) //if there's invisible or unblocked tile between, it's good
return false; return false;
@ -509,4 +509,4 @@ bool compareArtifacts(const CArtifactInstance *a1, const CArtifactInstance *a2)
return true; return true;
else else
return art1->price > art2->price; return art1->price > art2->price;
} }

View File

@ -119,34 +119,34 @@ public:
void unregisterAllInterfaces(); //stops delivering information about game events to player interfaces -> can be called ONLY after victory/loss void unregisterAllInterfaces(); //stops delivering information about game events to player interfaces -> can be called ONLY after victory/loss
//commands //commands
bool moveHero(const CGHeroInstance *h, int3 dst, bool transit = false); //dst must be free, neighbouring tile (this function can move hero only by one tile) bool moveHero(const CGHeroInstance *h, int3 dst, bool transit = false) override; //dst must be free, neighbouring tile (this function can move hero only by one tile)
bool teleportHero(const CGHeroInstance *who, const CGTownInstance *where); bool teleportHero(const CGHeroInstance *who, const CGTownInstance *where);
int selectionMade(int selection, QueryID queryID); int selectionMade(int selection, QueryID queryID) override;
int swapCreatures(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2); int swapCreatures(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override;
int mergeOrSwapStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2); //first goes to the second int mergeOrSwapStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override; //first goes to the second
int mergeStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2); //first goes to the second int mergeStacks(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2) override; //first goes to the second
int splitStack(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2, int val); int splitStack(const CArmedInstance *s1, const CArmedInstance *s2, SlotID p1, SlotID p2, int val) override;
bool dismissHero(const CGHeroInstance * hero); bool dismissHero(const CGHeroInstance * hero) override;
//bool swapArtifacts(const CGHeroInstance * hero1, ui16 pos1, const CGHeroInstance * hero2, ui16 pos2); //bool swapArtifacts(const CGHeroInstance * hero1, ui16 pos1, const CGHeroInstance * hero2, ui16 pos2);
bool swapArtifacts(const ArtifactLocation &l1, const ArtifactLocation &l2); bool swapArtifacts(const ArtifactLocation &l1, const ArtifactLocation &l2) override;
//bool moveArtifact(const CGHeroInstance * hero, ui16 src, const CStackInstance * stack, ui16 dest); // TODO: unify classes //bool moveArtifact(const CGHeroInstance * hero, ui16 src, const CStackInstance * stack, ui16 dest); // TODO: unify classes
//bool moveArtifact(const CStackInstance * stack, ui16 src , const CGHeroInstance * hero, ui16 dest); // TODO: unify classes //bool moveArtifact(const CStackInstance * stack, ui16 src , const CGHeroInstance * hero, ui16 dest); // TODO: unify classes
bool assembleArtifacts(const CGHeroInstance * hero, ArtifactPosition artifactSlot, bool assemble, ArtifactID assembleTo); bool assembleArtifacts(const CGHeroInstance * hero, ArtifactPosition artifactSlot, bool assemble, ArtifactID assembleTo) override;
bool buildBuilding(const CGTownInstance *town, BuildingID buildingID) override; bool buildBuilding(const CGTownInstance *town, BuildingID buildingID) override;
void recruitCreatures(const CGDwelling * obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1); void recruitCreatures(const CGDwelling * obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1) override;
bool dismissCreature(const CArmedInstance *obj, SlotID stackPos); bool dismissCreature(const CArmedInstance *obj, SlotID stackPos) override;
bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE) override; bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE) override;
void endTurn(); void endTurn() override;
void swapGarrisonHero(const CGTownInstance *town); void swapGarrisonHero(const CGTownInstance *town) override;
void buyArtifact(const CGHeroInstance *hero, ArtifactID aid) override; void buyArtifact(const CGHeroInstance *hero, ArtifactID aid) override;
void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, int id1, int id2, int val1, const CGHeroInstance *hero = nullptr); void trade(const CGObjectInstance *market, EMarketMode::EMarketMode mode, int id1, int id2, int val1, const CGHeroInstance *hero = nullptr) override;
void setFormation(const CGHeroInstance * hero, bool tight); void setFormation(const CGHeroInstance * hero, bool tight) override;
void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero); void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero) override;
void save(const std::string &fname); void save(const std::string &fname) override;
void sendMessage(const std::string &mess, const CGObjectInstance * currentObject = nullptr); void sendMessage(const std::string &mess, const CGObjectInstance * currentObject = nullptr) override;
void buildBoat(const IShipyard *obj); void buildBoat(const IShipyard *obj) override;
void dig(const CGObjectInstance *hero); void dig(const CGObjectInstance *hero) override;
void castSpell(const CGHeroInstance *hero, SpellID spellID, const int3 &pos = int3(-1, -1, -1)); void castSpell(const CGHeroInstance *hero, SpellID spellID, const int3 &pos = int3(-1, -1, -1)) override;
//friends //friends
friend class CClient; friend class CClient;

View File

@ -45,7 +45,7 @@ public:
CComponent *comp; CComponent *comp;
//blit component with image centered at this position //blit component with image centered at this position
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
//ComponentResolved(); //c-tor //ComponentResolved(); //c-tor
ComponentResolved(CComponent *Comp); //c-tor ComponentResolved(CComponent *Comp); //c-tor

View File

@ -52,10 +52,10 @@ private:
public: public:
CSoundHandler(); CSoundHandler();
void init(); void init() override;
void release(); void release() override;
void setVolume(ui32 percent); void setVolume(ui32 percent) override;
// Sounds // Sounds
int playSound(soundBase::soundID soundID, int repeats=0); int playSound(soundBase::soundID soundID, int repeats=0);
@ -127,9 +127,9 @@ public:
/// add entry with URI musicURI in set. Track will have ID musicID /// add entry with URI musicURI in set. Track will have ID musicID
void addEntryToSet(std::string set, int musicID, std::string musicURI); void addEntryToSet(std::string set, int musicID, std::string musicURI);
void init(); void init() override;
void release(); void release() override;
void setVolume(ui32 percent); void setVolume(ui32 percent) override;
/// play track by URI, if loop = true music will be looped /// play track by URI, if loop = true music will be looped
void playMusic(std::string musicURI, bool loop); void playMusic(std::string musicURI, bool loop);

View File

@ -147,11 +147,11 @@ public:
void newStackInserted(const StackLocation &location, const CStackInstance &stack) override; //new stack inserted at given (previously empty position) void newStackInserted(const StackLocation &location, const CStackInstance &stack) override; //new stack inserted at given (previously empty position)
void stacksRebalanced(const StackLocation &src, const StackLocation &dst, TQuantity count) override; //moves creatures from src stack to dst slot, may be used for merging/splittint/moving stacks void stacksRebalanced(const StackLocation &src, const StackLocation &dst, TQuantity count) override; //moves creatures from src stack to dst slot, may be used for merging/splittint/moving stacks
void artifactPut(const ArtifactLocation &al); void artifactPut(const ArtifactLocation &al) override;
void artifactRemoved(const ArtifactLocation &al); void artifactRemoved(const ArtifactLocation &al) override;
void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst); void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst) override;
void artifactAssembled(const ArtifactLocation &al); void artifactAssembled(const ArtifactLocation &al) override;
void artifactDisassembled(const ArtifactLocation &al); void artifactDisassembled(const ArtifactLocation &al) override;
void heroCreated(const CGHeroInstance* hero) override; void heroCreated(const CGHeroInstance* hero) override;
void heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, QueryID queryID) override; void heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, QueryID queryID) override;
@ -236,7 +236,7 @@ public:
void openTownWindow(const CGTownInstance * town); //shows townscreen void openTownWindow(const CGTownInstance * town); //shows townscreen
void openHeroWindow(const CGHeroInstance * hero); //shows hero window with given hero void openHeroWindow(const CGHeroInstance * hero); //shows hero window with given hero
void updateInfo(const CGObjectInstance * specific); void updateInfo(const CGObjectInstance * specific);
void init(shared_ptr<CCallback> CB); void init(shared_ptr<CCallback> CB) override;
int3 repairScreenPos(int3 pos); //returns position closest to pos we can center screen on int3 repairScreenPos(int3 pos); //returns position closest to pos we can center screen on
// show dialogs // show dialogs

View File

@ -207,7 +207,7 @@ public:
template <typename T> class CApplyOnPG : public CBaseForPGApply template <typename T> class CApplyOnPG : public CBaseForPGApply
{ {
public: public:
void applyOnPG(CSelectionScreen *selScr, void *pack) const void applyOnPG(CSelectionScreen *selScr, void *pack) const override
{ {
T *ptr = static_cast<T*>(pack); T *ptr = static_cast<T*>(pack);
ptr->apply(selScr); ptr->apply(selScr);
@ -217,7 +217,7 @@ public:
template <> class CApplyOnPG<CPack> : public CBaseForPGApply template <> class CApplyOnPG<CPack> : public CBaseForPGApply
{ {
public: public:
void applyOnPG(CSelectionScreen *selScr, void *pack) const void applyOnPG(CSelectionScreen *selScr, void *pack) const override
{ {
logGlobal->errorStream() << "Cannot apply on PG plain CPack!"; logGlobal->errorStream() << "Cannot apply on PG plain CPack!";
assert(0); assert(0);

View File

@ -75,10 +75,10 @@ public:
}; };
CMenuScreen(const JsonNode& configNode); CMenuScreen(const JsonNode& configNode);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void activate(); void activate() override;
void deactivate(); void deactivate() override;
void switchToTab(size_t index); void switchToTab(size_t index);
}; };
@ -100,10 +100,10 @@ class CreditsScreen : public CIntObject
public: public:
CreditsScreen(); CreditsScreen();
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
}; };
/// Implementation of the chat box /// Implementation of the chat box
@ -115,7 +115,7 @@ public:
CChatBox(const Rect &rect); CChatBox(const Rect &rect);
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void addNewMessage(const std::string &text); void addNewMessage(const std::string &text);
}; };
@ -136,8 +136,8 @@ public:
CDefHandler *sizes, *sFlags; CDefHandler *sizes, *sFlags;
void changeSelection(const CMapInfo *to); void changeSelection(const CMapInfo *to);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void showTeamsPopup(); void showTeamsPopup();
void toggleChat(); void toggleChat();
void setChat(bool activateChat); void setChat(bool activateChat);
@ -184,10 +184,10 @@ public:
void selectFName(std::string fname); void selectFName(std::string fname);
const CMapInfo * getSelectedMapInfo() const; const CMapInfo * getSelectedMapInfo() const;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void onDoubleClick(); void onDoubleClick() override;
SelectionTab(CMenuScreen::EState Type, const std::function<void(CMapInfo *)> &OnSelect, CMenuScreen::EMultiMode MultiPlayer = CMenuScreen::SINGLE_PLAYER); SelectionTab(CMenuScreen::EState Type, const std::function<void(CMapInfo *)> &OnSelect, CMenuScreen::EMultiMode MultiPlayer = CMenuScreen::SINGLE_PLAYER);
~SelectionTab(); ~SelectionTab();
}; };
@ -235,7 +235,7 @@ public:
CLabel *subtitle; CLabel *subtitle;
SelectedBox(Point position, PlayerSettings & settings, SelType type); SelectedBox(Point position, PlayerSettings & settings, SelType type);
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void update(); void update();
}; };
@ -254,7 +254,7 @@ public:
PlayerOptionsEntry(OptionsTab *owner, PlayerSettings &S); PlayerOptionsEntry(OptionsTab *owner, PlayerSettings &S);
void selectButtons(); //hides unavailable buttons void selectButtons(); //hides unavailable buttons
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void update(); void update();
}; };
@ -282,7 +282,7 @@ public:
void recreate(); void recreate();
OptionsTab(); OptionsTab();
~OptionsTab(); ~OptionsTab();
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
int nextAllowedHero(PlayerColor player, int min, int max, int incl, int dir ); int nextAllowedHero(PlayerColor player, int min, int max, int incl, int dir );
@ -295,7 +295,7 @@ class CRandomMapTab : public CIntObject
public: public:
CRandomMapTab(); CRandomMapTab();
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void updateMapInfo(); void updateMapInfo();
CFunctionList<void (const CMapInfo *)> & getMapInfoChanged(); CFunctionList<void (const CMapInfo *)> & getMapInfoChanged();
const CMapInfo * getMapInfo() const; const CMapInfo * getMapInfo() const;
@ -385,7 +385,7 @@ public:
void postRequest(ui8 what, ui8 dir) override; void postRequest(ui8 what, ui8 dir) override;
void postChatMessage(const std::string &txt) override; void postChatMessage(const std::string &txt) override;
void propagateNames(); void propagateNames();
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
}; };
/// Save game screen /// Save game screen
@ -454,8 +454,8 @@ class CPrologEpilogVideo : public CWindowObject
public: public:
CPrologEpilogVideo(CCampaignScenario::SScenarioPrologEpilog _spe, std::function<void()> callback); CPrologEpilogVideo(CCampaignScenario::SScenarioPrologEpilog _spe, std::function<void()> callback);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
}; };
/// Campaign screen where you can choose one out of three starting bonuses /// Campaign screen where you can choose one out of three starting bonuses
@ -498,9 +498,9 @@ private:
CRegion(CBonusSelection * _owner, bool _accessible, bool _selectable, int _myNumber); CRegion(CBonusSelection * _owner, bool _accessible, bool _selectable, int _myNumber);
~CRegion(); ~CRegion();
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
}; };
void init(); void init();
@ -560,12 +560,12 @@ private:
std::string video; // the resource name of the video std::string video; // the resource name of the video
std::string hoverText; std::string hoverText;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
public: public:
CCampaignButton(const JsonNode &config ); CCampaignButton(const JsonNode &config );
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
}; };
CButton *back; CButton *back;
@ -578,7 +578,7 @@ public:
enum CampaignSet {ROE, AB, SOD, WOG}; enum CampaignSet {ROE, AB, SOD, WOG};
CCampaignScreen(const JsonNode &config); CCampaignScreen(const JsonNode &config);
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
}; };
/// Manages the configuration of pregame GUI elements like campaign screen, main menu, loading screen,... /// Manages the configuration of pregame GUI elements like campaign screen, main menu, loading screen,...
@ -629,7 +629,7 @@ public:
CLoadingScreen(std::function<void()> loader); CLoadingScreen(std::function<void()> loader);
~CLoadingScreen(); ~CLoadingScreen();
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
}; };
/// Simple window to enter the server's address. /// Simple window to enter the server's address.

View File

@ -72,12 +72,12 @@ public:
template <typename T> class CApplyOnCL : public CBaseForCLApply template <typename T> class CApplyOnCL : public CBaseForCLApply
{ {
public: public:
void applyOnClAfter(CClient *cl, void *pack) const void applyOnClAfter(CClient *cl, void *pack) const override
{ {
T *ptr = static_cast<T*>(pack); T *ptr = static_cast<T*>(pack);
ptr->applyCl(cl); ptr->applyCl(cl);
} }
void applyOnClBefore(CClient *cl, void *pack) const void applyOnClBefore(CClient *cl, void *pack) const override
{ {
T *ptr = static_cast<T*>(pack); T *ptr = static_cast<T*>(pack);
ptr->applyFirstCl(cl); ptr->applyFirstCl(cl);
@ -87,12 +87,12 @@ public:
template <> class CApplyOnCL<CPack> : public CBaseForCLApply template <> class CApplyOnCL<CPack> : public CBaseForCLApply
{ {
public: public:
void applyOnClAfter(CClient *cl, void *pack) const void applyOnClAfter(CClient *cl, void *pack) const override
{ {
logGlobal->errorStream() << "Cannot apply on CL plain CPack!"; logGlobal->errorStream() << "Cannot apply on CL plain CPack!";
assert(0); assert(0);
} }
void applyOnClBefore(CClient *cl, void *pack) const void applyOnClBefore(CClient *cl, void *pack) const override
{ {
logGlobal->errorStream() << "Cannot apply on CL plain CPack!"; logGlobal->errorStream() << "Cannot apply on CL plain CPack!";
assert(0); assert(0);

View File

@ -189,7 +189,7 @@ public:
bool changeStackType(const StackLocation &sl, const CCreature *c) override {return false;}; bool changeStackType(const StackLocation &sl, const CCreature *c) override {return false;};
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override {return false;}; bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override {return false;};
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;}; bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;};
bool eraseStack(const StackLocation &sl, bool forceRemoval = false){return false;}; bool eraseStack(const StackLocation &sl, bool forceRemoval = false) override{return false;};
bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) override {return false;} bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) override {return false;}
bool addToSlot(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;} 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 {} void tryJoiningArmy(const CArmedInstance *src, const CArmedInstance *dst, bool removeObjWhenFinished, bool allowMerging) override {}

View File

@ -782,7 +782,7 @@ bool CShootingAnimation::init()
spi.catapultInfo.reset(new CatapultProjectileInfo(Point(spi.x, spi.y), destPos)); spi.catapultInfo.reset(new CatapultProjectileInfo(Point(spi.x, spi.y), destPos));
double animSpeed = AnimationControls::getProjectileSpeed() / 10; double animSpeed = AnimationControls::getProjectileSpeed() / 10;
spi.lastStep = abs((destPos.x - spi.x) / animSpeed); spi.lastStep = std::abs((destPos.x - spi.x) / animSpeed);
spi.dx = animSpeed; spi.dx = animSpeed;
spi.dy = 0; spi.dy = 0;

View File

@ -59,8 +59,8 @@ protected:
const CStack *attackingStack; const CStack *attackingStack;
int attackingStackPosBeforeReturn; //for stacks with return_after_strike feature int attackingStackPosBeforeReturn; //for stacks with return_after_strike feature
public: public:
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
bool checkInitialConditions(); bool checkInitialConditions();
CAttackAnimation(CBattleInterface *_owner, const CStack *attacker, BattleHex _dest, const CStack *defender); CAttackAnimation(CBattleInterface *_owner, const CStack *attacker, BattleHex _dest, const CStack *defender);
@ -80,9 +80,9 @@ class CDefenceAnimation : public CBattleStackAnimation
float timeToWait; // for how long this animation should be paused float timeToWait; // for how long this animation should be paused
public: public:
bool init(); bool init() override;
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner); CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner);
virtual ~CDefenceAnimation(){}; virtual ~CDefenceAnimation(){};
@ -94,9 +94,9 @@ private:
int counter; int counter;
int howMany; int howMany;
public: public:
bool init(); bool init() override;
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
CDummyAnimation(CBattleInterface * _owner, int howManyFrames); CDummyAnimation(CBattleInterface * _owner, int howManyFrames);
virtual ~CDummyAnimation(){} virtual ~CDummyAnimation(){}
@ -106,8 +106,8 @@ public:
class CMeleeAttackAnimation : public CAttackAnimation class CMeleeAttackAnimation : public CAttackAnimation
{ {
public: public:
bool init(); bool init() override;
void endAnim(); void endAnim() override;
CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked); CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked);
virtual ~CMeleeAttackAnimation(){}; virtual ~CMeleeAttackAnimation(){};
@ -133,9 +133,9 @@ private:
public: public:
BattleHex nextHex; // next hex, to which creature move right now BattleHex nextHex; // next hex, to which creature move right now
bool init(); bool init() override;
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
CMovementAnimation(CBattleInterface *_owner, const CStack *_stack, std::vector<BattleHex> _destTiles, int _distance); CMovementAnimation(CBattleInterface *_owner, const CStack *_stack, std::vector<BattleHex> _destTiles, int _distance);
virtual ~CMovementAnimation(){}; virtual ~CMovementAnimation(){};
@ -147,8 +147,8 @@ class CMovementEndAnimation : public CBattleStackAnimation
private: private:
BattleHex destinationTile; BattleHex destinationTile;
public: public:
bool init(); bool init() override;
void endAnim(); void endAnim() override;
CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, BattleHex destTile); CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, BattleHex destTile);
virtual ~CMovementEndAnimation(){}; virtual ~CMovementEndAnimation(){};
@ -158,8 +158,8 @@ public:
class CMovementStartAnimation : public CBattleStackAnimation class CMovementStartAnimation : public CBattleStackAnimation
{ {
public: public:
bool init(); bool init() override;
void endAnim(); void endAnim() override;
CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack); CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack);
virtual ~CMovementStartAnimation(){}; virtual ~CMovementStartAnimation(){};
@ -171,12 +171,12 @@ class CReverseAnimation : public CBattleStackAnimation
BattleHex hex; BattleHex hex;
public: public:
bool priority; //true - high, false - low bool priority; //true - high, false - low
bool init(); bool init() override;
static void rotateStack(CBattleInterface * owner, const CStack * stack, BattleHex hex); static void rotateStack(CBattleInterface * owner, const CStack * stack, BattleHex hex);
void setupSecondPart(); void setupSecondPart();
void endAnim(); void endAnim() override;
CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority); CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority);
virtual ~CReverseAnimation(){}; virtual ~CReverseAnimation(){};
@ -204,9 +204,9 @@ class CShootingAnimation : public CAttackAnimation
private: private:
int catapultDamage; int catapultDamage;
public: public:
bool init(); bool init() override;
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
//last two params only for catapult attacks //last two params only for catapult attacks
CShootingAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, CShootingAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest,
@ -225,9 +225,9 @@ private:
bool Vflip; bool Vflip;
bool alignToBottom; bool alignToBottom;
public: public:
bool init(); bool init() override;
void nextFrame(); void nextFrame() override;
void endAnim(); void endAnim() override;
CSpellEffectAnimation(CBattleInterface * _owner, ui32 _effect, BattleHex _destTile, int _dx = 0, int _dy = 0, bool _Vflip = false, bool _alignToBottom = false); CSpellEffectAnimation(CBattleInterface * _owner, ui32 _effect, BattleHex _destTile, int _dx = 0, int _dy = 0, bool _Vflip = false, bool _alignToBottom = false);
CSpellEffectAnimation(CBattleInterface * _owner, std::string _customAnim, int _x, int _y, int _dx = 0, int _dy = 0, bool _Vflip = false, bool _alignToBottom = false); CSpellEffectAnimation(CBattleInterface * _owner, std::string _customAnim, int _x, int _y, int _dx = 0, int _dy = 0, bool _Vflip = false, bool _alignToBottom = false);

View File

@ -291,14 +291,14 @@ public:
void bEndTacticPhase(); void bEndTacticPhase();
//end of button handle funcs //end of button handle funcs
//napisz tu klase odpowiadajaca za wyswietlanie bitwy i obsluge uzytkownika, polecenia ma przekazywac callbackiem //napisz tu klase odpowiadajaca za wyswietlanie bitwy i obsluge uzytkownika, polecenia ma przekazywac callbackiem
void activate(); void activate() override;
void deactivate(); void deactivate() override;
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void mouseMoved(const SDL_MouseMotionEvent &sEvent); void mouseMoved(const SDL_MouseMotionEvent &sEvent) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void show(SDL_Surface *to); void show(SDL_Surface *to) override;
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
//call-ins //call-ins
void startAction(const BattleAction* action); void startAction(const BattleAction* action);

View File

@ -38,7 +38,7 @@ public:
std::string ingcAlter; //alternative text set by in-game console - very important! std::string ingcAlter; //alternative text set by in-game console - very important!
int whoSetAlter; //who set alter text; 0 - battle interface or none, 1 - button int whoSetAlter; //who set alter text; 0 - battle interface or none, 1 - button
CBattleConsole(); CBattleConsole();
void showAll(SDL_Surface * to = 0); void showAll(SDL_Surface * to = 0) override;
bool addText(const std::string &text); //adds text at the last position; returns false if failed (e.g. text longer than 70 characters) bool addText(const std::string &text); //adds text at the last position; returns false if failed (e.g. text longer than 70 characters)
void alterText(const std::string &text); //place string at alterTxt void alterText(const std::string &text); //place string at alterTxt
void eraseText(ui32 pos); //erases added text at position pos void eraseText(ui32 pos); //erases added text at position pos
@ -60,9 +60,9 @@ public:
int nextPhase; //stage of animation to be set after current phase is fully displayed int nextPhase; //stage of animation to be set after current phase is fully displayed
int currentFrame, firstFrame, lastFrame; //frame of animation int currentFrame, firstFrame, lastFrame; //frame of animation
ui8 flagAnim, animCount; //for flag animation ui8 flagAnim, animCount; //for flag animation
void show(SDL_Surface * to); //prints next frame of animation to to void show(SDL_Surface * to) override; //prints next frame of animation to to
void setPhase(int newPhase); //sets phase of hero animation void setPhase(int newPhase); //sets phase of hero animation
void clickLeft(tribool down, bool previousState); //call-in void clickLeft(tribool down, bool previousState) override; //call-in
CBattleHero(const std::string &defName, bool filpG, PlayerColor player, const CGHeroInstance *hero, const CBattleInterface *owner); //c-tor CBattleHero(const std::string &defName, bool filpG, PlayerColor player, const CGHeroInstance *hero, const CBattleInterface *owner); //c-tor
~CBattleHero(); //d-tor ~CBattleHero(); //d-tor
}; };
@ -96,8 +96,8 @@ public:
void bExitf(); //exit button callback void bExitf(); //exit button callback
void activate(); void activate() override;
void show(SDL_Surface * to = 0); void show(SDL_Surface * to = 0) override;
}; };
/// Class which stands for a single hex field on a battlefield /// Class which stands for a single hex field on a battlefield
@ -114,10 +114,10 @@ public:
static Point getXYUnitAnim(BattleHex hexNum, const CStack * creature, CBattleInterface * cbi); //returns (x, y) of left top corner of animation static Point getXYUnitAnim(BattleHex hexNum, const CStack * creature, CBattleInterface * cbi); //returns (x, y) of left top corner of animation
//for user interactions //for user interactions
void hover (bool on); void hover (bool on) override;
void mouseMoved (const SDL_MouseMotionEvent &sEvent); void mouseMoved (const SDL_MouseMotionEvent &sEvent) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
CClickableHex(); CClickableHex();
}; };
@ -132,7 +132,7 @@ class CStackQueue : public CIntObject
const CStack *stack; const CStack *stack;
bool small; bool small;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void setStack(const CStack *nStack); void setStack(const CStack *nStack);
StackBox(bool small); StackBox(bool small);
}; };
@ -150,6 +150,6 @@ public:
CStackQueue(bool Embedded, CBattleInterface * _owner); CStackQueue(bool Embedded, CBattleInterface * _owner);
~CStackQueue(); ~CStackQueue();
void update(); void update();
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
void blitBg(SDL_Surface * to); void blitBg(SDL_Surface * to);
}; };

View File

@ -98,10 +98,10 @@ public:
SDLImage(SDL_Surface * from, bool extraRef); SDLImage(SDL_Surface * from, bool extraRef);
~SDLImage(); ~SDLImage();
void draw(SDL_Surface *where, int posX=0, int posY=0, Rect *src=nullptr, ui8 alpha=255) const; void draw(SDL_Surface *where, int posX=0, int posY=0, Rect *src=nullptr, ui8 alpha=255) const override;
void playerColored(PlayerColor player); void playerColored(PlayerColor player) override;
int width() const; int width() const override;
int height() const; int height() const override;
friend class SDLImageLoader; friend class SDLImageLoader;
}; };
@ -144,10 +144,10 @@ public:
CompImage(SDL_Surface * surf); CompImage(SDL_Surface * surf);
~CompImage(); ~CompImage();
void draw(SDL_Surface *where, int posX=0, int posY=0, Rect *src=nullptr, ui8 alpha=255) const; void draw(SDL_Surface *where, int posX=0, int posY=0, Rect *src=nullptr, ui8 alpha=255) const override;
void playerColored(PlayerColor player); void playerColored(PlayerColor player) override;
int width() const; int width() const override;
int height() const; int height() const override;
friend class CompImageLoader; friend class CompImageLoader;
}; };

View File

@ -157,15 +157,15 @@ public:
// activate or deactivate object. Inactive object won't receive any input events (keyboard\mouse) // activate or deactivate object. Inactive object won't receive any input events (keyboard\mouse)
// usually used automatically by parent // usually used automatically by parent
void activate(); void activate() override;
void deactivate(); void deactivate() override;
//called each frame to update screen //called each frame to update screen
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
//called on complete redraw only //called on complete redraw only
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
//request complete redraw of this object //request complete redraw of this object
void redraw(); void redraw() override;
enum EAlignment {TOPLEFT, CENTER, BOTTOMRIGHT}; enum EAlignment {TOPLEFT, CENTER, BOTTOMRIGHT};
@ -212,5 +212,5 @@ public:
CKeyShortcut(); CKeyShortcut();
CKeyShortcut(int key); CKeyShortcut(int key);
CKeyShortcut(std::set<int> Keys); CKeyShortcut(std::set<int> Keys);
virtual void keyPressed(const SDL_KeyboardEvent & key); //call-in virtual void keyPressed(const SDL_KeyboardEvent & key) override; //call-in
}; };

View File

@ -113,7 +113,7 @@ template<typename IntType>
std::string makeNumberShort(IntType number, IntType maxLength = 3) //the output is a string containing at most 5 characters [4 if positive] (eg. intead 10000 it gives 10k) std::string makeNumberShort(IntType number, IntType maxLength = 3) //the output is a string containing at most 5 characters [4 if positive] (eg. intead 10000 it gives 10k)
{ {
IntType max = pow(10, maxLength); IntType max = pow(10, maxLength);
if (abs(number) < max) if (std::abs(number) < max)
return boost::lexical_cast<std::string>(number); return boost::lexical_cast<std::string>(number);
std::string symbols = " kMGTPE"; std::string symbols = " kMGTPE";

View File

@ -312,7 +312,7 @@ class CMapHandler
void drawHeroFlag(SDL_Surface * targetSurf, SDL_Surface * sourceSurf, SDL_Rect * sourceRect, SDL_Rect * destRect, bool moving) const override; void drawHeroFlag(SDL_Surface * targetSurf, SDL_Surface * sourceSurf, SDL_Rect * sourceRect, SDL_Rect * destRect, bool moving) const override;
void drawObject(SDL_Surface * targetSurf, SDL_Surface * sourceSurf, SDL_Rect * sourceRect, bool moving) const override; void drawObject(SDL_Surface * targetSurf, SDL_Surface * sourceSurf, SDL_Rect * sourceRect, bool moving) const override;
void drawFrame(SDL_Surface * targetSurf) const override {} void drawFrame(SDL_Surface * targetSurf) const override {}
void drawOverlayEx(SDL_Surface * targetSurf); void drawOverlayEx(SDL_Surface * targetSurf) override;
void init(const MapDrawingInfo * info) override; void init(const MapDrawingInfo * info) override;
SDL_Rect clip(SDL_Surface * targetSurf) const override; SDL_Rect clip(SDL_Surface * targetSurf) const override;

View File

@ -37,9 +37,9 @@ protected:
CListItem(CList * parent); CListItem(CList * parent);
~CListItem(); ~CListItem();
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
void onSelect(bool on); void onSelect(bool on);
/// create object with selection rectangle /// create object with selection rectangle
@ -118,12 +118,12 @@ class CHeroList : public CList
CHeroItem(CHeroList *parent, const CGHeroInstance * hero); CHeroItem(CHeroList *parent, const CGHeroInstance * hero);
CIntObject * genSelection(); CIntObject * genSelection() override;
void update(); void update();
void select(bool on); void select(bool on) override;
void open(); void open() override;
void showTooltip(); void showTooltip() override;
std::string getHoverText(); std::string getHoverText() override;
}; };
CIntObject * createHeroItem(size_t index); CIntObject * createHeroItem(size_t index);
@ -152,12 +152,12 @@ class CTownList : public CList
CTownItem(CTownList *parent, const CGTownInstance * town); CTownItem(CTownList *parent, const CGTownInstance * town);
CIntObject * genSelection(); CIntObject * genSelection() override;
void update(); void update();
void select(bool on); void select(bool on) override;
void open(); void open() override;
void showTooltip(); void showTooltip() override;
std::string getHoverText(); std::string getHoverText() override;
}; };
CIntObject * createTownItem(size_t index); CIntObject * createTownItem(size_t index);
@ -195,7 +195,7 @@ public:
CMinimapInstance(CMinimap * parent, int level); CMinimapInstance(CMinimap * parent, int level);
~CMinimapInstance(); ~CMinimapInstance();
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
void tileToPixels (const int3 &tile, int &x, int &y,int toX = 0, int toY = 0); void tileToPixels (const int3 &tile, int &x, int &y,int toX = 0, int toY = 0);
void refreshTile(const int3 &pos); void refreshTile(const int3 &pos);
@ -213,10 +213,10 @@ protected:
//to initialize colors //to initialize colors
std::map<int, std::pair<SDL_Color, SDL_Color> > loadColors(std::string from); std::map<int, std::pair<SDL_Color, SDL_Color> > loadColors(std::string from);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover (bool on); void hover (bool on) override;
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent) override;
void moveAdvMapSelection(); void moveAdvMapSelection();
@ -232,7 +232,7 @@ public:
void setLevel(int level); void setLevel(int level);
void setAIRadar(bool on); void setAIRadar(bool on);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void hideTile(const int3 &pos); //puts FoW void hideTile(const int3 &pos); //puts FoW
void showTile(const int3 &pos); //removes FoW void showTile(const int3 &pos); //removes FoW
@ -256,7 +256,7 @@ class CInfoBar : public CIntObject
public: public:
CVisibleInfo(Point position); CVisibleInfo(Point position);
void show(SDL_Surface *to); void show(SDL_Surface *to) override;
//functions that must be called only once //functions that must be called only once
void loadHero(const CGHeroInstance * hero); void loadHero(const CGHeroInstance * hero);
@ -283,11 +283,11 @@ class CInfoBar : public CIntObject
//removes all information about current state, deactivates timer (if any) //removes all information about current state, deactivates timer (if any)
void reset(EState newState); void reset(EState newState);
void tick(); void tick() override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
public: public:
CInfoBar(const Rect & pos); CInfoBar(const Rect & pos);
@ -331,7 +331,7 @@ public:
/// recolors all buttons to given player color /// recolors all buttons to given player color
void setPlayerColor(const PlayerColor & clr); void setPlayerColor(const PlayerColor & clr);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// specialized version of CAdvMapPanel that handles recolorable def-based pictures for world view info panel /// specialized version of CAdvMapPanel that handles recolorable def-based pictures for world view info panel
@ -351,7 +351,7 @@ public:
void addChildIcon(std::pair<int, Point> data, const CDefHandler *def, int indexOffset); void addChildIcon(std::pair<int, Point> data, const CDefHandler *def, int indexOffset);
/// recreates all pictures from given def to recolor them according to current player color /// recreates all pictures from given def to recolor them according to current player color
void recolorIcons(const PlayerColor &color, const CDefHandler *def, int indexOffset); void recolorIcons(const PlayerColor &color, const CDefHandler *def, int indexOffset);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
class CInGameConsole : public CIntObject class CInGameConsole : public CIntObject
@ -365,9 +365,9 @@ private:
int maxDisplayedTexts; //hiw many texts can be displayed simultaneously int maxDisplayedTexts; //hiw many texts can be displayed simultaneously
public: public:
std::string enteredText; std::string enteredText;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void print(const std::string &txt); void print(const std::string &txt);
void keyPressed (const SDL_KeyboardEvent & key); //call-in void keyPressed (const SDL_KeyboardEvent & key) override; //call-in
void textInputed(const SDL_TextInputEvent & event) override; void textInputed(const SDL_TextInputEvent & event) override;
void textEdited(const SDL_TextEditingEvent & event) override; void textEdited(const SDL_TextEditingEvent & event) override;

View File

@ -215,7 +215,7 @@ public:
void clickLeft(tribool down, bool previousState) override; void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState) override; void clickRight(tribool down, bool previousState) override;
void wheelScrolled(bool down, bool in); void wheelScrolled(bool down, bool in) override;
}; };
/// A typical slider which can be orientated horizontally/vertically. /// A typical slider which can be orientated horizontally/vertically.
@ -264,11 +264,11 @@ public:
void addCallback(std::function<void(int)> callback); void addCallback(std::function<void(int)> callback);
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void wheelScrolled(bool down, bool in); void wheelScrolled(bool down, bool in) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
/// @param position coordinates of slider /// @param position coordinates of slider
/// @param length length of slider ribbon, including left/right buttons /// @param length length of slider ribbon, including left/right buttons

View File

@ -35,10 +35,10 @@ class CWindowWithArtifacts : public CArtifactHolder
public: public:
std::vector<CArtifactsOfHero *> artSets; std::vector<CArtifactsOfHero *> artSets;
void artifactRemoved(const ArtifactLocation &artLoc); void artifactRemoved(const ArtifactLocation &artLoc) override;
void artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc); void artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc) override;
void artifactDisassembled(const ArtifactLocation &artLoc); void artifactDisassembled(const ArtifactLocation &artLoc) override;
void artifactAssembled(const ArtifactLocation &artLoc); void artifactAssembled(const ArtifactLocation &artLoc) override;
}; };
/// Artifacts can be placed there. Gets shown at the hero window /// Artifacts can be placed there. Gets shown at the hero window
@ -65,11 +65,11 @@ public:
const CArtifactInstance * ourArt; // should be changed only with setArtifact() const CArtifactInstance * ourArt; // should be changed only with setArtifact()
CArtPlace(Point position, const CArtifactInstance * Art = nullptr); //c-tor CArtPlace(Point position, const CArtifactInstance * Art = nullptr); //c-tor
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void select (); void select ();
void deselect (); void deselect ();
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
bool fitsHere (const CArtifactInstance * art) const; //returns true if given artifact can be placed here bool fitsHere (const CArtifactInstance * art) const; //returns true if given artifact can be placed here
void setMeAsDest(bool backpackAsVoid = true); void setMeAsDest(bool backpackAsVoid = true);

View File

@ -57,7 +57,7 @@ public:
CComponent(Etype Type, int Subtype, int Val = 0, ESize imageSize=large);//c-tor CComponent(Etype Type, int Subtype, int Val = 0, ESize imageSize=large);//c-tor
CComponent(const Component &c, ESize imageSize=large); //c-tor CComponent(const Component &c, ESize imageSize=large); //c-tor
void clickRight(tribool down, bool previousState); //call-in void clickRight(tribool down, bool previousState) override; //call-in
}; };
/// component that can be selected or deselected /// component that can be selected or deselected
@ -68,10 +68,10 @@ public:
bool selected; //if true, this component is selected bool selected; //if true, this component is selected
std::function<void()> onSelect; //function called on selection change std::function<void()> onSelect; //function called on selection change
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void select(bool on); void select(bool on);
void clickLeft(tribool down, bool previousState); //call-in void clickLeft(tribool down, bool previousState) override; //call-in
CSelectableComponent(Etype Type, int Sub, int Val, ESize imageSize=large, std::function<void()> OnSelect = nullptr); //c-tor CSelectableComponent(Etype Type, int Sub, int Val, ESize imageSize=large, std::function<void()> OnSelect = nullptr); //c-tor
CSelectableComponent(const Component &c, std::function<void()> OnSelect = nullptr); //c-tor CSelectableComponent(const Component &c, std::function<void()> OnSelect = nullptr); //c-tor
}; };

View File

@ -47,12 +47,12 @@ class CGarrisonSlot : public CIntObject
void setHighlight(bool on); void setHighlight(bool on);
public: public:
virtual void hover (bool on); //call-in virtual void hover (bool on) override; //call-in
const CArmedInstance * getObj() const; const CArmedInstance * getObj() const;
bool our() const; bool our() const;
bool ally() const; bool ally() const;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void update(); void update();
CGarrisonSlot(CGarrisonInt *Owner, int x, int y, SlotID IID, EGarrisonType Upg=EGarrisonType::UP, const CStackInstance * Creature=nullptr); CGarrisonSlot(CGarrisonInt *Owner, int x, int y, SlotID IID, EGarrisonType Upg=EGarrisonType::UP, const CStackInstance * Creature=nullptr);
@ -132,7 +132,7 @@ class CWindowWithGarrison : public virtual CGarrisonHolder
{ {
public: public:
CGarrisonInt *garr; CGarrisonInt *garr;
virtual void updateGarrisons(); virtual void updateGarrisons() override;
}; };
/// Garrison window where you can take creatures out of the hero to place it on the garrison /// Garrison window where you can take creatures out of the hero to place it on the garrison

View File

@ -49,8 +49,8 @@ public:
void scaleTo(Point size); void scaleTo(Point size);
void createSimpleRect(const Rect &r, bool screenFormat, ui32 color); void createSimpleRect(const Rect &r, bool screenFormat, ui32 color);
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void convertToScreenBPP(); void convertToScreenBPP();
void colorizeAndConvert(PlayerColor player); void colorizeAndConvert(PlayerColor player);
void colorize(PlayerColor player); void colorize(PlayerColor player);
@ -64,7 +64,7 @@ class CFilledTexture : CIntObject
public: public:
CFilledTexture(std::string imageName, Rect position); CFilledTexture(std::string imageName, Rect position);
~CFilledTexture(); ~CFilledTexture();
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
}; };
/// Class for displaying one image from animation /// Class for displaying one image from animation
@ -94,7 +94,7 @@ public:
//makes image player-colored //makes image player-colored
void playerColored(PlayerColor player); void playerColored(PlayerColor player);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// Base class for displaying animation, used as superclass for different animations /// Base class for displaying animation, used as superclass for different animations
@ -155,8 +155,8 @@ public:
virtual void reset(); virtual void reset();
//show current frame and increase counter //show current frame and increase counter
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// Creature-dependend animations like attacking, moving,... /// Creature-dependend animations like attacking, moving,...
@ -210,7 +210,7 @@ private:
public: public:
//change anim to next if queue is not empty, call callback othervice //change anim to next if queue is not empty, call callback othervice
void reset(); void reset() override;
//add sequence to the end of queue //add sequence to the end of queue
void addLast(EAnimType newType); void addLast(EAnimType newType);

View File

@ -28,7 +28,7 @@ class CHoverableArea: public virtual CIntObject
public: public:
std::string hoverText; std::string hoverText;
virtual void hover (bool on); virtual void hover (bool on) override;
CHoverableArea(); CHoverableArea();
virtual ~CHoverableArea(); virtual ~CHoverableArea();
@ -45,8 +45,8 @@ public:
virtual ~LRClickableAreaWText(); virtual ~LRClickableAreaWText();
void init(); void init();
virtual void clickLeft(tribool down, bool previousState); virtual void clickLeft(tribool down, bool previousState) override;
virtual void clickRight(tribool down, bool previousState); virtual void clickRight(tribool down, bool previousState) override;
}; };
/// base class for hero/town/garrison tooltips /// base class for hero/town/garrison tooltips
@ -88,7 +88,7 @@ private:
CCreatureAnim *anim; //displayed animation CCreatureAnim *anim; //displayed animation
CLabel * amount; CLabel * amount;
void show(SDL_Surface *to); void show(SDL_Surface *to) override;
public: public:
CCreaturePic(int x, int y, const CCreature *cre, bool Big=true, bool Animated=true); //c-tor CCreaturePic(int x, int y, const CCreature *cre, bool Big=true, bool Animated=true); //c-tor
@ -100,8 +100,8 @@ class CMinorResDataBar : public CIntObject
{ {
public: public:
SDL_Surface *bg; //background bitmap SDL_Surface *bg; //background bitmap
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
CMinorResDataBar(); //c-tor CMinorResDataBar(); //c-tor
~CMinorResDataBar(); //d-tor ~CMinorResDataBar(); //d-tor
}; };
@ -114,9 +114,9 @@ public:
CHeroArea(int x, int y, const CGHeroInstance * _hero); CHeroArea(int x, int y, const CGHeroInstance * _hero);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
}; };
/// Can interact on left and right mouse clicks /// Can interact on left and right mouse clicks
@ -125,8 +125,8 @@ class LRClickableAreaWTextComp: public LRClickableAreaWText
public: public:
int baseType; int baseType;
int bonusValue, type; int bonusValue, type;
virtual void clickLeft(tribool down, bool previousState); virtual void clickLeft(tribool down, bool previousState) override;
virtual void clickRight(tribool down, bool previousState); virtual void clickRight(tribool down, bool previousState) override;
LRClickableAreaWTextComp(const Rect &Pos = Rect(0,0,0,0), int BaseType = -1); LRClickableAreaWTextComp(const Rect &Pos = Rect(0,0,0,0), int BaseType = -1);
CComponent * createComponent() const; CComponent * createComponent() const;
@ -137,8 +137,8 @@ class LRClickableAreaOpenTown: public LRClickableAreaWTextComp
{ {
public: public:
const CGTownInstance * town; const CGTownInstance * town;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
LRClickableAreaOpenTown(); LRClickableAreaOpenTown();
}; };

View File

@ -52,7 +52,7 @@ public:
CLabel(int x=0, int y=0, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, CLabel(int x=0, int y=0, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT,
const SDL_Color &Color = Colors::WHITE, const std::string &Text = ""); const SDL_Color &Color = Colors::WHITE, const std::string &Text = "");
void showAll(SDL_Surface * to); //shows statusbar (with current text) void showAll(SDL_Surface * to) override; //shows statusbar (with current text)
}; };
/// Small helper class to manage group of similar labels /// Small helper class to manage group of similar labels
@ -85,8 +85,8 @@ public:
CMultiLineLabel(Rect position, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = Colors::WHITE, const std::string &Text = ""); CMultiLineLabel(Rect position, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = Colors::WHITE, const std::string &Text = "");
void setText(const std::string &Txt); void setText(const std::string &Txt) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void setVisibleSize(Rect visibleSize); void setVisibleSize(Rect visibleSize);
// scrolls text visible in widget. Positive value will move text up // scrolls text visible in widget. Positive value will move text up
@ -125,7 +125,7 @@ public:
void clear();//clears statusbar and refreshes void clear();//clears statusbar and refreshes
void setText(const std::string & Text) override; //prints text and refreshes statusbar void setText(const std::string & Text) override; //prints text and refreshes statusbar
void show(SDL_Surface * to); //shows statusbar (with current text) void show(SDL_Surface * to) override; //shows statusbar (with current text)
CGStatusBar(CPicture *BG, EFonts Font = FONT_SMALL, EAlignment Align = CENTER, const SDL_Color &Color = Colors::WHITE); //given CPicture will be captured by created sbar and it's pos will be used as pos for sbar CGStatusBar(CPicture *BG, EFonts Font = FONT_SMALL, EAlignment Align = CENTER, const SDL_Color &Color = Colors::WHITE); //given CPicture will be captured by created sbar and it's pos will be used as pos for sbar
CGStatusBar(int x, int y, std::string name, int maxw=-1); CGStatusBar(int x, int y, std::string name, int maxw=-1);

View File

@ -65,13 +65,13 @@ public:
CTerrainRect(); CTerrainRect();
virtual ~CTerrainRect(); virtual ~CTerrainRect();
CGPath * currentPath; CGPath * currentPath;
void deactivate(); void deactivate() override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void showAnim(SDL_Surface * to); void showAnim(SDL_Surface * to);
void showPath(const SDL_Rect * extRect, SDL_Surface * to); void showPath(const SDL_Rect * extRect, SDL_Surface * to);
int3 whichTileIsIt(const int & x, const int & y); //x,y are cursor position int3 whichTileIsIt(const int & x, const int & y); //x,y are cursor position
@ -92,14 +92,14 @@ public:
std::vector<std::pair<int,int> > txtpos; std::vector<std::pair<int,int> > txtpos;
std::string datetext; std::string datetext;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
CResDataBar(); CResDataBar();
CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist); CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist);
~CResDataBar(); ~CResDataBar();
void draw(SDL_Surface * to); void draw(SDL_Surface * to);
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// That's a huge class which handles general adventure map actions and /// That's a huge class which handles general adventure map actions and
@ -197,11 +197,11 @@ public:
void fnextHero(); void fnextHero();
void fendTurn(); void fendTurn();
void activate(); void activate() override;
void deactivate(); void deactivate() override;
void show(SDL_Surface * to); //redraws terrain void show(SDL_Surface * to) override; //redraws terrain
void showAll(SDL_Surface * to); //shows and activates adv. map interface void showAll(SDL_Surface * to) override; //shows and activates adv. map interface
void select(const CArmedInstance *sel, bool centerView = true); void select(const CArmedInstance *sel, bool centerView = true);
void selectionChanged(); void selectionChanged();
@ -209,8 +209,8 @@ public:
void centerOn(const CGObjectInstance *obj, bool fade = false); void centerOn(const CGObjectInstance *obj, bool fade = false);
int3 verifyPos(int3 ver); int3 verifyPos(int3 ver);
void handleRightClick(std::string text, tribool down); void handleRightClick(std::string text, tribool down);
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent) override;
bool isActive(); bool isActive();
bool isHeroSleeping(const CGHeroInstance *hero); bool isHeroSleeping(const CGHeroInstance *hero);

View File

@ -51,12 +51,12 @@ public:
CBuildingRect(CCastleBuildings * Par, const CGTownInstance *Town, const CStructure *Str); //c-tor CBuildingRect(CCastleBuildings * Par, const CGTownInstance *Town, const CStructure *Str); //c-tor
~CBuildingRect(); //d-tor ~CBuildingRect(); //d-tor
bool operator<(const CBuildingRect & p2) const; bool operator<(const CBuildingRect & p2) const;
void hover(bool on); void hover(bool on) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void mouseMoved (const SDL_MouseMotionEvent & sEvent); void mouseMoved (const SDL_MouseMotionEvent & sEvent) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// Dwelling info box - right-click screen for dwellings /// Dwelling info box - right-click screen for dwellings
@ -88,10 +88,10 @@ public:
void setHighlight(bool on); void setHighlight(bool on);
void set(const CGHeroInstance *newHero); void set(const CGHeroInstance *newHero);
void hover (bool on); void hover (bool on) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void deactivate(); void deactivate() override;
CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h, HeroSlots * Owner); //c-tor CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h, HeroSlots * Owner); //c-tor
~CHeroGSlot(); //d-tor ~CHeroGSlot(); //d-tor
}; };
@ -150,8 +150,8 @@ public:
void addBuilding(BuildingID building); void addBuilding(BuildingID building);
void removeBuilding(BuildingID building);//FIXME: not tested!!! void removeBuilding(BuildingID building);//FIXME: not tested!!!
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
/// Creature info window /// Creature info window
@ -172,9 +172,9 @@ public:
CCreaInfo(Point position, const CGTownInstance *Town, int Level, bool compact=false, bool showAvailable=false); CCreaInfo(Point position, const CGTownInstance *Town, int Level, bool compact=false, bool showAvailable=false);
void update(); void update();
void hover(bool on); void hover(bool on) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
}; };
/// Town hall and fort icons for town screen /// Town hall and fort icons for town screen
@ -187,8 +187,8 @@ public:
//if (townHall) hall-capital else fort - castle //if (townHall) hall-capital else fort - castle
CTownInfo(int posX, int posY, const CGTownInstance* town, bool townHall); CTownInfo(int posX, int posY, const CGTownInstance* town, bool townHall);
void hover(bool on); void hover(bool on) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
}; };
/// Class which manages the castle window /// Class which manages the castle window
@ -226,7 +226,7 @@ public:
void castleTeleport(int where); void castleTeleport(int where);
void townChange(); void townChange();
void keyPressed(const SDL_KeyboardEvent & key); void keyPressed(const SDL_KeyboardEvent & key) override;
void close(); void close();
void addBuilding(BuildingID bid); void addBuilding(BuildingID bid);
void removeBuilding(BuildingID bid); void removeBuilding(BuildingID bid);
@ -251,9 +251,9 @@ class CHallInterface : public CWindowObject
public: public:
CBuildingBox(int x, int y, const CGTownInstance * Town, const CBuilding * Building); CBuildingBox(int x, int y, const CGTownInstance * Town, const CBuilding * Building);
void hover(bool on); void hover(bool on) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
}; };
const CGTownInstance * town; const CGTownInstance * town;
@ -294,7 +294,7 @@ class LabeledValue : public CIntObject
public: public:
LabeledValue(Rect size, std::string name, std::string descr, int min, int max); LabeledValue(Rect size, std::string name, std::string descr, int min, int max);
LabeledValue(Rect size, std::string name, std::string descr, int val); LabeledValue(Rect size, std::string name, std::string descr, int val);
void hover(bool on); void hover(bool on) override;
}; };
/// The fort screen where you can afford units /// The fort screen where you can afford units
@ -321,9 +321,9 @@ class CFortScreen : public CWindowObject
RecruitArea(int posX, int posY, const CGTownInstance *town, int level); RecruitArea(int posX, int posY, const CGTownInstance *town, int level);
void creaturesChanged(); void creaturesChanged();
void hover(bool on); void hover(bool on) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
}; };
CLabel *title; CLabel *title;
std::vector<RecruitArea*> recAreas; std::vector<RecruitArea*> recAreas;
@ -349,9 +349,9 @@ class CMageGuildScreen : public CWindowObject
public: public:
Scroll(Point position, const CSpell *Spell); Scroll(Point position, const CSpell *Spell);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
}; };
CPicture *window; CPicture *window;
CButton *exit; CButton *exit;

View File

@ -35,7 +35,7 @@ class CHeroSwitcher : public CIntObject
const CGHeroInstance * hero; const CGHeroInstance * hero;
CAnimImage *image; CAnimImage *image;
public: public:
virtual void clickLeft(tribool down, bool previousState); virtual void clickLeft(tribool down, bool previousState) override;
CHeroSwitcher(Point pos, const CGHeroInstance * hero); CHeroSwitcher(Point pos, const CGHeroInstance * hero);
}; };
@ -85,7 +85,7 @@ public:
CHeroWindow(const CGHeroInstance *hero); //c-tor CHeroWindow(const CGHeroInstance *hero); //c-tor
void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero void update(const CGHeroInstance * hero, bool redrawNeeded = false); //sets main displayed hero
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void dismissCurrent(); //dissmissed currently displayed hero (curHero) void dismissCurrent(); //dissmissed currently displayed hero (curHero)
void questlog(); //show quest log in hero window void questlog(); //show quest log in hero window

View File

@ -74,8 +74,8 @@ public:
InfoBox(Point position, InfoPos Pos, InfoSize Size, IInfoBoxData *Data); InfoBox(Point position, InfoPos Pos, InfoSize Size, IInfoBoxData *Data);
~InfoBox(); ~InfoBox();
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
//Update object if data may have changed //Update object if data may have changed
//void update(); //void update();
@ -121,13 +121,13 @@ protected:
public: public:
InfoBoxAbstractHeroData(InfoType Type); InfoBoxAbstractHeroData(InfoType Type);
std::string getValueText(); std::string getValueText() override;
std::string getNameText(); std::string getNameText() override;
std::string getImageName(InfoBox::InfoSize size); std::string getImageName(InfoBox::InfoSize size) override;
std::string getHoverText(); std::string getHoverText() override;
size_t getImageIndex(); size_t getImageIndex() override;
bool prepareMessage(std::string &text, CComponent **comp); bool prepareMessage(std::string &text, CComponent **comp) override;
}; };
class InfoBoxHeroData : public InfoBoxAbstractHeroData class InfoBoxHeroData : public InfoBoxAbstractHeroData
@ -135,17 +135,17 @@ class InfoBoxHeroData : public InfoBoxAbstractHeroData
const CGHeroInstance * hero; const CGHeroInstance * hero;
int index;//index of data in hero (0-7 for sec. skill, 0-3 for pr. skill) int index;//index of data in hero (0-7 for sec. skill, 0-3 for pr. skill)
int getSubID(); int getSubID() override;
si64 getValue(); si64 getValue() override;
public: public:
InfoBoxHeroData(InfoType Type, const CGHeroInstance *Hero, int Index=0); InfoBoxHeroData(InfoType Type, const CGHeroInstance *Hero, int Index=0);
//To get a bit different texts for hero window //To get a bit different texts for hero window
std::string getHoverText(); std::string getHoverText() override;
std::string getValueText(); std::string getValueText() override;
bool prepareMessage(std::string &text, CComponent **comp); bool prepareMessage(std::string &text, CComponent **comp) override;
}; };
class InfoBoxCustomHeroData : public InfoBoxAbstractHeroData class InfoBoxCustomHeroData : public InfoBoxAbstractHeroData
@ -153,8 +153,8 @@ class InfoBoxCustomHeroData : public InfoBoxAbstractHeroData
int subID;//subID of data (0=attack...) int subID;//subID of data (0=attack...)
si64 value;//actual value of data, 64-bit to fit experience and negative values si64 value;//actual value of data, 64-bit to fit experience and negative values
int getSubID(); int getSubID() override;
si64 getValue(); si64 getValue() override;
public: public:
InfoBoxCustomHeroData(InfoType Type, int subID, si64 value); InfoBoxCustomHeroData(InfoType Type, int subID, si64 value);
@ -171,13 +171,13 @@ public:
InfoBoxCustom(std::string ValueText, std::string NameText, std::string ImageName, size_t ImageIndex, std::string HoverText=""); InfoBoxCustom(std::string ValueText, std::string NameText, std::string ImageName, size_t ImageIndex, std::string HoverText="");
std::string getValueText(); std::string getValueText() override;
std::string getNameText(); std::string getNameText() override;
std::string getImageName(InfoBox::InfoSize size); std::string getImageName(InfoBox::InfoSize size) override;
std::string getHoverText(); std::string getHoverText() override;
size_t getImageIndex(); size_t getImageIndex() override;
bool prepareMessage(std::string &text, CComponent **comp); bool prepareMessage(std::string &text, CComponent **comp) override;
}; };
//TODO!!! //TODO!!!
@ -191,11 +191,11 @@ public:
InfoBoxTownData(InfoType Type, const CGTownInstance * Town, int Index); InfoBoxTownData(InfoType Type, const CGTownInstance * Town, int Index);
InfoBoxTownData(InfoType Type, int SubID, int Value); InfoBoxTownData(InfoType Type, int SubID, int Value);
std::string getValueText(); std::string getValueText() override;
std::string getNameText(); std::string getNameText() override;
std::string getImageName(InfoBox::InfoSize size); std::string getImageName(InfoBox::InfoSize size) override;
std::string getHoverText(); std::string getHoverText() override;
size_t getImageIndex(); size_t getImageIndex() override;
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -250,11 +250,11 @@ public:
CKingdomInterface(); CKingdomInterface();
void townChanged(const CGTownInstance *town); void townChanged(const CGTownInstance *town);
void updateGarrisons(); void updateGarrisons() override;
void artifactRemoved(const ArtifactLocation &artLoc); void artifactRemoved(const ArtifactLocation &artLoc) override;
void artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc); void artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc) override;
void artifactDisassembled(const ArtifactLocation &artLoc); void artifactDisassembled(const ArtifactLocation &artLoc) override;
void artifactAssembled(const ArtifactLocation &artLoc); void artifactAssembled(const ArtifactLocation &artLoc) override;
}; };
/// List item with town /// List item with town
@ -277,7 +277,7 @@ public:
CTownItem(const CGTownInstance* town); CTownItem(const CGTownInstance* town);
void updateGarrisons(); void updateGarrisons() override;
void update(); void update();
}; };
@ -325,7 +325,7 @@ private:
public: public:
CKingdHeroList(size_t maxSize); CKingdHeroList(size_t maxSize);
void updateGarrisons(); void updateGarrisons() override;
}; };
/// Tab with all town-specific data /// Tab with all town-specific data
@ -344,5 +344,5 @@ public:
CKingdTownList(size_t maxSize); CKingdTownList(size_t maxSize);
void townChanged(const CGTownInstance *town); void townChanged(const CGTownInstance *town);
void updateGarrisons(); void updateGarrisons() override;
}; };

View File

@ -41,8 +41,8 @@ public:
CQuestLabel (Rect position, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = Colors::WHITE, const std::string &Text = "") CQuestLabel (Rect position, EFonts Font = FONT_SMALL, EAlignment Align = TOPLEFT, const SDL_Color &Color = Colors::WHITE, const std::string &Text = "")
: CMultiLineLabel (position, FONT_SMALL, TOPLEFT, Colors::WHITE, Text){}; : CMultiLineLabel (position, FONT_SMALL, TOPLEFT, Colors::WHITE, Text){};
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
class CQuestIcon : public CAnimImage class CQuestIcon : public CAnimImage
@ -52,17 +52,17 @@ public:
CQuestIcon (const std::string &defname, int index, int x=0, int y=0); CQuestIcon (const std::string &defname, int index, int x=0, int y=0);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
class CQuestMinimap : public CMinimap class CQuestMinimap : public CMinimap
{ {
std::vector <shared_ptr<CQuestIcon>> icons; std::vector <shared_ptr<CQuestIcon>> icons;
void clickLeft(tribool down, bool previousState){}; //minimap ignores clicking on its surface void clickLeft(tribool down, bool previousState) override{}; //minimap ignores clicking on its surface
void iconClicked(); void iconClicked();
void mouseMoved (const SDL_MouseMotionEvent & sEvent){}; void mouseMoved (const SDL_MouseMotionEvent & sEvent) override{};
public: public:
@ -73,7 +73,7 @@ public:
void update(); void update();
void addQuestMarks (const QuestInfo * q); void addQuestMarks (const QuestInfo * q);
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
}; };
class CQuestLog : public CWindowObject class CQuestLog : public CWindowObject
@ -106,5 +106,5 @@ public:
void recreateLabelList(); void recreateLabelList();
void recreateQuestList (int pos); void recreateQuestList (int pos);
void toggleComplete(bool on); void toggleComplete(bool on);
void showAll (SDL_Surface * to); void showAll (SDL_Surface * to) override;
}; };

View File

@ -50,10 +50,10 @@ public:
void showAllAt(const Point &dstPos, const std::string &customSub, SDL_Surface * to); void showAllAt(const Point &dstPos, const std::string &customSub, SDL_Surface * to);
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover (bool on); void hover (bool on) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
std::string getName(int number = -1) const; std::string getName(int number = -1) const;
CTradeableItem(Point pos, EType Type, int ID, bool Left, int Serial); CTradeableItem(Point pos, EType Type, int ID, bool Left, int Serial);
}; };
@ -74,7 +74,7 @@ public:
CTradeWindow(std::string bgName, const IMarket *Market, const CGHeroInstance *Hero, EMarketMode::EMarketMode Mode); //c CTradeWindow(std::string bgName, const IMarket *Market, const CGHeroInstance *Hero, EMarketMode::EMarketMode Mode); //c
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void initSubs(bool Left); void initSubs(bool Left);
void initTypes(); void initTypes();
@ -109,19 +109,19 @@ public:
void setMax(); void setMax();
void sliderMoved(int to); void sliderMoved(int to);
void makeDeal(); void makeDeal();
void selectionChanged(bool side); //true == left void selectionChanged(bool side) override; //true == left
CMarketplaceWindow(const IMarket *Market, const CGHeroInstance *Hero = nullptr, EMarketMode::EMarketMode Mode = EMarketMode::RESOURCE_RESOURCE); //c-tor CMarketplaceWindow(const IMarket *Market, const CGHeroInstance *Hero = nullptr, EMarketMode::EMarketMode Mode = EMarketMode::RESOURCE_RESOURCE); //c-tor
~CMarketplaceWindow(); //d-tor ~CMarketplaceWindow(); //d-tor
Point selectionOffset(bool Left) const; Point selectionOffset(bool Left) const override;
std::string selectionSubtitle(bool Left) const; std::string selectionSubtitle(bool Left) const override;
void garrisonChanged(); //removes creatures with count 0 from the list (apparently whole stack has been sold) void garrisonChanged() override; //removes creatures with count 0 from the list (apparently whole stack has been sold)
void artifactsChanged(bool left); void artifactsChanged(bool left) override;
void resourceChanged(int type, int val); void resourceChanged(int type, int val);
void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const; void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const override;
void updateTraderText(); void updateTraderText();
}; };
@ -141,24 +141,24 @@ public:
CLabel *expToLevel, *expOnAltar; CLabel *expToLevel, *expOnAltar;
void selectionChanged(bool side); //true == left void selectionChanged(bool side) override; //true == left
void SacrificeAll(); void SacrificeAll();
void SacrificeBackpack(); void SacrificeBackpack();
void putOnAltar(int backpackIndex); void putOnAltar(int backpackIndex);
bool putOnAltar(CTradeableItem* altarSlot, const CArtifactInstance *art); bool putOnAltar(CTradeableItem* altarSlot, const CArtifactInstance *art);
void makeDeal(); void makeDeal();
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void blockTrade(); void blockTrade();
void sliderMoved(int to); void sliderMoved(int to);
void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const; void getBaseForPositions(EType type, int &dx, int &dy, int &x, int &y, int &h, int &w, bool Right, int &leftToRightOffset) const override;
void mimicCres(); void mimicCres();
Point selectionOffset(bool Left) const; Point selectionOffset(bool Left) const override;
std::string selectionSubtitle(bool Left) const; std::string selectionSubtitle(bool Left) const override;
void garrisonChanged(); void garrisonChanged() override;
void artifactsChanged(bool left); void artifactsChanged(bool left) override;
void calcTotalExp(); void calcTotalExp();
void setExpToLevel(); void setExpToLevel();
void updateRight(CTradeableItem *toUpdate); void updateRight(CTradeableItem *toUpdate);

View File

@ -39,9 +39,9 @@ protected:
//Simple function with call to GH.popInt //Simple function with call to GH.popInt
void close(); void close();
//Used only if RCLICK_POPUP was set //Used only if RCLICK_POPUP was set
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
//To display border //To display border
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
//change or set background image //change or set background image
void setBackground(std::string filename); void setBackground(std::string filename);
void updateShadow(); void updateShadow();

View File

@ -43,9 +43,9 @@ class CRecruitmentWindow : public CWindowObject
CCreaturePic *pic; //creature's animation CCreaturePic *pic; //creature's animation
bool selected; bool selected;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
public: public:
const CCreature * creature; const CCreature * creature;
si32 amount; si32 amount;
@ -88,7 +88,7 @@ class CRecruitmentWindow : public CWindowObject
void buy(); void buy();
void sliderMoved(int to); void sliderMoved(int to);
void showAll(SDL_Surface *to); void showAll(SDL_Surface *to) override;
public: public:
const CGDwelling * const dwelling; const CGDwelling * const dwelling;
CRecruitmentWindow(const CGDwelling *Dwelling, int Level, const CArmedInstance *Dst, const std::function<void(CreatureID,int)> & Recruit, int y_offset = 0); //creatures - pairs<creature_ID,amount> //c-tor CRecruitmentWindow(const CGDwelling *Dwelling, int Level, const CArmedInstance *Dst, const std::function<void(CreatureID,int)> & Recruit, int y_offset = 0); //creatures - pairs<creature_ID,amount> //c-tor
@ -153,7 +153,7 @@ class CObjectListWindow : public CWindowObject
CItem(CObjectListWindow *parent, size_t id, std::string text); CItem(CObjectListWindow *parent, size_t id, std::string text);
void select(bool on); void select(bool on);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
}; };
std::function<void(int)> onSelect;//called when OK button is pressed, returns id of selected item. std::function<void(int)> onSelect;//called when OK button is pressed, returns id of selected item.
@ -180,7 +180,7 @@ public:
CIntObject *genItem(size_t index); CIntObject *genItem(size_t index);
void elementSelected();//call callback and close this window void elementSelected();//call callback and close this window
void changeSelection(size_t which); void changeSelection(size_t which);
void keyPressed (const SDL_KeyboardEvent & key); void keyPressed (const SDL_KeyboardEvent & key) override;
}; };
class CSystemOptionsWindow : public CWindowObject class CSystemOptionsWindow : public CWindowObject
@ -232,9 +232,9 @@ public:
std::string description; // "XXX is a level Y ZZZ with N artifacts" std::string description; // "XXX is a level Y ZZZ with N artifacts"
const CGHeroInstance *h; const CGHeroInstance *h;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover (bool on); void hover (bool on) override;
HeroPortrait(int &sel, int id, int x, int y, const CGHeroInstance *H); HeroPortrait(int &sel, int id, int x, int y, const CGHeroInstance *H);
private: private:
@ -255,7 +255,7 @@ public:
void recruitb(); void recruitb();
void thievesguildb(); void thievesguildb();
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
}; };
class CExchangeWindow : public CWindowObject, public CWindowWithGarrison, public CWindowWithArtifacts class CExchangeWindow : public CWindowObject, public CWindowWithGarrison, public CWindowWithArtifacts
@ -319,8 +319,8 @@ private:
ui8 currentAlpha; ui8 currentAlpha;
public: public:
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
CPuzzleWindow(const int3 &grailPos, double discoveredRatio); CPuzzleWindow(const int3 &grailPos, double discoveredRatio);
}; };
@ -339,7 +339,7 @@ public:
CAnimImage *icon; CAnimImage *icon;
void move(); void move();
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void update(); void update();
CItem(CTransformerWindow * parent, int size, int id); CItem(CTransformerWindow * parent, int size, int id);
}; };
@ -353,7 +353,7 @@ public:
CGStatusBar *bar; CGStatusBar *bar;
void makeDeal(); void makeDeal();
void addAll(); void addAll();
void updateGarrisons(); void updateGarrisons() override;
CTransformerWindow(const CGHeroInstance * _hero, const CGTownInstance * _town); //c-tor CTransformerWindow(const CGHeroInstance * _hero, const CGTownInstance * _town); //c-tor
}; };
@ -365,10 +365,10 @@ class CUniversityWindow : public CWindowObject
int ID;//id of selected skill int ID;//id of selected skill
CUniversityWindow * parent; CUniversityWindow * parent;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
void hover(bool on); void hover(bool on) override;
int state();//0=can't learn, 1=learned, 2=can learn int state();//0=can't learn, 1=learned, 2=can learn
CItem(CUniversityWindow * _parent, int _ID, int X, int Y); CItem(CUniversityWindow * _parent, int _ID, int X, int Y);
}; };
@ -419,12 +419,12 @@ public:
CHillFortWindow(const CGHeroInstance *visitor, const CGObjectInstance *object); //c-tor CHillFortWindow(const CGHeroInstance *visitor, const CGObjectInstance *object); //c-tor
void showAll (SDL_Surface *to); void showAll (SDL_Surface *to) override;
std::string getDefForSlot(SlotID slot);//return def name for this slot std::string getDefForSlot(SlotID slot);//return def name for this slot
std::string getTextForSlot(SlotID slot);//return hover text for this slot std::string getTextForSlot(SlotID slot);//return hover text for this slot
void makeDeal(SlotID slot);//-1 for upgrading all creatures void makeDeal(SlotID slot);//-1 for upgrading all creatures
int getState(SlotID slot); //-1 = no creature 0=can't upgrade, 1=upgraded, 2=can upgrade int getState(SlotID slot); //-1 = no creature 0=can't upgrade, 1=upgraded, 2=can upgrade
void updateGarrisons();//update buttons after garrison changes void updateGarrisons() override;//update buttons after garrison changes
}; };
class CThievesGuildWindow : public CWindowObject class CThievesGuildWindow : public CWindowObject

View File

@ -31,7 +31,7 @@ class CSimpleWindow : public CIntObject
{ {
public: public:
SDL_Surface * bitmap; //background SDL_Surface * bitmap; //background
virtual void show(SDL_Surface * to); virtual void show(SDL_Surface * to) override;
CSimpleWindow():bitmap(nullptr){}; //c-tor CSimpleWindow():bitmap(nullptr){}; //c-tor
virtual ~CSimpleWindow(); //d-tor virtual ~CSimpleWindow(); //d-tor
}; };
@ -53,8 +53,8 @@ public:
void setDelComps(bool DelComps); void setDelComps(bool DelComps);
virtual void close(); virtual void close();
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
void sliderMoved(int to); void sliderMoved(int to);
CInfoWindow(std::string Text, PlayerColor player, const TCompsInfo &comps = TCompsInfo(), const TButtonsInfo &Buttons = TButtonsInfo(), bool delComps = true); //c-tor CInfoWindow(std::string Text, PlayerColor player, const TCompsInfo &comps = TCompsInfo(), const TButtonsInfo &Buttons = TButtonsInfo(), bool delComps = true); //c-tor
@ -76,7 +76,7 @@ class CRClickPopup : public CIntObject
{ {
public: public:
virtual void close(); virtual void close();
void clickRight(tribool down, bool previousState); void clickRight(tribool down, bool previousState) override;
CRClickPopup(); CRClickPopup();
virtual ~CRClickPopup(); //d-tor virtual ~CRClickPopup(); //d-tor
@ -94,8 +94,8 @@ public:
IShowActivatable *inner; IShowActivatable *inner;
bool delInner; bool delInner;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
void showAll(SDL_Surface * to); void showAll(SDL_Surface * to) override;
CRClickPopupInt(IShowActivatable *our, bool deleteInt); //c-tor CRClickPopupInt(IShowActivatable *our, bool deleteInt); //c-tor
virtual ~CRClickPopupInt(); //d-tor virtual ~CRClickPopupInt(); //d-tor
}; };
@ -105,8 +105,8 @@ class CInfoPopup : public CRClickPopup
public: public:
bool free; //TODO: comment me bool free; //TODO: comment me
SDL_Surface * bitmap; //popup background SDL_Surface * bitmap; //popup background
void close(); void close() override;
void show(SDL_Surface * to); void show(SDL_Surface * to) override;
CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false); //c-tor CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false); //c-tor
CInfoPopup(SDL_Surface * Bitmap, const Point &p, EAlignment alignment, bool Free=false); //c-tor CInfoPopup(SDL_Surface * Bitmap, const Point &p, EAlignment alignment, bool Free=false); //c-tor
CInfoPopup(SDL_Surface * Bitmap = nullptr, bool Free = false); //default c-tor CInfoPopup(SDL_Surface * Bitmap = nullptr, bool Free = false); //default c-tor

View File

@ -93,7 +93,7 @@ public:
std::vector <std::pair <ui16, Bonus> > bonusesPerLevel; //bonus given each n levels std::vector <std::pair <ui16, Bonus> > bonusesPerLevel; //bonus given each n levels
std::vector <std::pair <ui16, Bonus> > thresholdBonuses; //after certain level they will be added once std::vector <std::pair <ui16, Bonus> > thresholdBonuses; //after certain level they will be added once
void levelUpArtifact (CArtifactInstance * art); void levelUpArtifact (CArtifactInstance * art) override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {

View File

@ -199,7 +199,7 @@ public:
/// generates tier-specific bonus tree entries /// generates tier-specific bonus tree entries
void buildBonusTreeForTiers(); void buildBonusTreeForTiers();
void afterLoadFinalization(); void afterLoadFinalization() override;
std::vector<JsonNode> loadLegacyData(size_t dataSize) override; std::vector<JsonNode> loadLegacyData(size_t dataSize) override;

View File

@ -68,7 +68,7 @@ public:
std::string getQuantityTXT(bool capitalized = true) const; std::string getQuantityTXT(bool capitalized = true) const;
virtual int getExpRank() const; virtual int getExpRank() const;
virtual int getLevel() const; //different for regular stack and commander virtual int getLevel() const; //different for regular stack and commander
si32 magicResistance() const; si32 magicResistance() const override;
CreatureID getCreatureID() const; //-1 if not available CreatureID getCreatureID() const; //-1 if not available
std::string getName() const; //plural or singular std::string getName() const; //plural or singular
virtual void init(); virtual void init();
@ -104,12 +104,12 @@ public:
CCommanderInstance (CreatureID id); CCommanderInstance (CreatureID id);
~CCommanderInstance(); ~CCommanderInstance();
void setAlive (bool alive); void setAlive (bool alive);
void giveStackExp (TExpType exp); void giveStackExp (TExpType exp) override;
void levelUp (); void levelUp ();
bool gainsLevel() const; //true if commander has lower level than should upon his experience bool gainsLevel() const; //true if commander has lower level than should upon his experience
ui64 getPower() const {return 0;}; ui64 getPower() const override {return 0;};
int getExpRank() const; int getExpRank() const override;
int getLevel() const override; int getLevel() const override;
ArtBearer::ArtBearer bearerType() const override; //from CArtifactSet ArtBearer::ArtBearer bearerType() const override; //from CArtifactSet

View File

@ -127,26 +127,26 @@ public:
virtual std::string getBattleAIName() const = 0; //has to return name of the battle AI to be used virtual std::string getBattleAIName() const = 0; //has to return name of the battle AI to be used
//battle interface //battle interface
virtual BattleAction activeStack(const CStack * stack); virtual BattleAction activeStack(const CStack * stack) override;
virtual void yourTacticPhase(int distance); virtual void yourTacticPhase(int distance) override;
virtual void battleNewRound(int round); virtual void battleNewRound(int round) override;
virtual void battleCatapultAttacked(const CatapultAttack & ca); virtual void battleCatapultAttacked(const CatapultAttack & ca) override;
virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side); virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) override;
virtual void battleStacksAttacked(const std::vector<BattleStackAttacked> & bsa); virtual void battleStacksAttacked(const std::vector<BattleStackAttacked> & bsa) override;
virtual void actionStarted(const BattleAction &action); virtual void actionStarted(const BattleAction &action) override;
virtual void battleNewRoundFirst(int round); virtual void battleNewRoundFirst(int round) override;
virtual void actionFinished(const BattleAction &action); virtual void actionFinished(const BattleAction &action) override;
virtual void battleStacksEffectsSet(const SetStackEffect & sse); virtual void battleStacksEffectsSet(const SetStackEffect & sse) override;
//virtual void battleTriggerEffect(const BattleTriggerEffect & bte); //virtual void battleTriggerEffect(const BattleTriggerEffect & bte);
virtual void battleStacksRemoved(const BattleStacksRemoved & bsr); virtual void battleStacksRemoved(const BattleStacksRemoved & bsr) override;
virtual void battleObstaclesRemoved(const std::set<si32> & removedObstacles); virtual void battleObstaclesRemoved(const std::set<si32> & removedObstacles) override;
virtual void battleNewStackAppeared(const CStack * stack); virtual void battleNewStackAppeared(const CStack * stack) override;
virtual void battleStackMoved(const CStack * stack, std::vector<BattleHex> dest, int distance); virtual void battleStackMoved(const CStack * stack, std::vector<BattleHex> dest, int distance) override;
virtual void battleAttack(const BattleAttack *ba); virtual void battleAttack(const BattleAttack *ba) override;
virtual void battleSpellCast(const BattleSpellCast *sc); virtual void battleSpellCast(const BattleSpellCast *sc) override;
virtual void battleEnd(const BattleResult *br); virtual void battleEnd(const BattleResult *br) override;
virtual void battleStacksHealedRes(const std::vector<std::pair<ui32, ui32> > & healedStacks, bool lifeDrain, bool tentHeal, si32 lifeDrainFrom); virtual void battleStacksHealedRes(const std::vector<std::pair<ui32, ui32> > & healedStacks, bool lifeDrain, bool tentHeal, si32 lifeDrainFrom) override;
virtual void saveGame(COSer & h, const int version); //saving virtual void saveGame(COSer & h, const int version) override; //saving
virtual void loadGame(CISer & h, const int version); //loading virtual void loadGame(CISer & h, const int version) override; //loading
}; };

View File

@ -63,7 +63,7 @@ public:
template <typename T> class CApplyOnGS : public CBaseForGSApply template <typename T> class CApplyOnGS : public CBaseForGSApply
{ {
public: public:
void applyOnGS(CGameState *gs, void *pack) const void applyOnGS(CGameState *gs, void *pack) const override
{ {
T *ptr = static_cast<T*>(pack); T *ptr = static_cast<T*>(pack);

View File

@ -159,7 +159,7 @@ void Unicode::trimRight(std::string & text, const size_t amount/* =1 */)
class LocaleWithComma: public std::numpunct<char> class LocaleWithComma: public std::numpunct<char>
{ {
protected: protected:
char do_decimal_point() const char do_decimal_point() const override
{ {
return ','; return ',';
} }

View File

@ -178,9 +178,9 @@ public:
void loadObject(std::string scope, std::string name, const JsonNode & data) override; void loadObject(std::string scope, std::string name, const JsonNode & data) override;
void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override; void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
void afterLoadFinalization(); void afterLoadFinalization() override;
std::vector<bool> getDefaultAllowed() const; std::vector<bool> getDefaultAllowed() const override;
~CHeroClassHandler(); ~CHeroClassHandler();
@ -244,7 +244,7 @@ public:
CHeroHandler(); //c-tor CHeroHandler(); //c-tor
~CHeroHandler(); //d-tor ~CHeroHandler(); //d-tor
std::vector<bool> getDefaultAllowed() const; std::vector<bool> getDefaultAllowed() const override;
/** /**
* Gets a list of default allowed abilities. OH3 abilities/skills are all allowed by default. * Gets a list of default allowed abilities. OH3 abilities/skills are all allowed by default.

View File

@ -1551,7 +1551,7 @@ public:
void openNextFile(const std::string &fname); //throws! void openNextFile(const std::string &fname); //throws!
void clear(); void clear();
void reportState(CLogger * out); void reportState(CLogger * out) override;
void putMagicBytes(const std::string &text); void putMagicBytes(const std::string &text);
@ -1578,7 +1578,7 @@ public:
void openNextFile(const boost::filesystem::path & fname, int minimalVersion); //throws! void openNextFile(const boost::filesystem::path & fname, int minimalVersion); //throws!
void clear(); void clear();
void reportState(CLogger * out); void reportState(CLogger * out) override;
void checkMagicBytes(const std::string & text); void checkMagicBytes(const std::string & text);
@ -1616,7 +1616,7 @@ class DLL_LINKAGE CConnection
CConnection(void); CConnection(void);
void init(); void init();
void reportState(CLogger * out); void reportState(CLogger * out) override;
public: public:
CISer iser; CISer iser;
COSer oser; COSer oser;

View File

@ -504,7 +504,7 @@ const TBonusListPtr IBonusBearer::getSpellBonuses() const
CSelector selector = Selector::sourceType(Bonus::SPELL_EFFECT) CSelector selector = Selector::sourceType(Bonus::SPELL_EFFECT)
.And(CSelector([](const Bonus * b)->bool .And(CSelector([](const Bonus * b)->bool
{ {
return !b->type == Bonus::NONE; return b->type != Bonus::NONE;
})); }));
return getBonuses(selector, Selector::anyRange(), cachingStr.str()); return getBonuses(selector, Selector::anyRange(), cachingStr.str());
} }

View File

@ -539,7 +539,7 @@ class DLL_LINKAGE CPropagatorNodeType : public IPropagator
public: public:
CPropagatorNodeType(); CPropagatorNodeType();
CPropagatorNodeType(int NodeType); CPropagatorNodeType(int NodeType);
bool shouldBeAttached(CBonusSystemNode *dest); bool shouldBeAttached(CBonusSystemNode *dest) override;
//CBonusSystemNode *getDestNode(CBonusSystemNode *source, CBonusSystemNode *redParent, CBonusSystemNode *redChild) override; //CBonusSystemNode *getDestNode(CBonusSystemNode *source, CBonusSystemNode *redParent, CBonusSystemNode *redChild) override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
@ -651,7 +651,7 @@ public:
void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here
TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convienence TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convienence
const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = nullptr, const std::string &cachingStr = "") const; const TBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = nullptr, const std::string &cachingStr = "") const override;
void getParents(TCNodes &out) const; //retrieves list of parent nodes (nodes to inherit bonuses from), void getParents(TCNodes &out) const; //retrieves list of parent nodes (nodes to inherit bonuses from),
const Bonus *getBonusLocalFirst(const CSelector &selector) const; const Bonus *getBonusLocalFirst(const CSelector &selector) const;

View File

@ -115,7 +115,7 @@ public:
numbers.clear(); numbers.clear();
} }
void toString(std::string &dst) const; void toString(std::string &dst) const;
std::string toString() const; std::string toString() const override;
void getLocalString(const std::pair<ui8,ui32> &txt, std::string &dst) const; void getLocalString(const std::pair<ui8,ui32> &txt, std::string &dst) const;
MetaString() MetaString()

View File

@ -42,7 +42,7 @@ public:
bool existsResource(const ResourceID & resourceName) const override; bool existsResource(const ResourceID & resourceName) const override;
std::string getMountPoint() const override; std::string getMountPoint() const override;
boost::optional<std::string> getResourceName(const ResourceID & resourceName) const override; boost::optional<std::string> getResourceName(const ResourceID & resourceName) const override;
std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const; std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const override;
private: private:
/** A list of files in this map /** A list of files in this map

View File

@ -62,7 +62,7 @@ public:
std::unique_ptr<CInputStream> load(const ResourceID & resourceName) const override; std::unique_ptr<CInputStream> load(const ResourceID & resourceName) const override;
bool existsResource(const ResourceID & resourceName) const override; bool existsResource(const ResourceID & resourceName) const override;
std::string getMountPoint() const override; std::string getMountPoint() const override;
std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const; std::unordered_set<ResourceID> getFilteredFiles(std::function<bool(const ResourceID &)> filter) const override;
private: private:
/** /**

View File

@ -116,7 +116,7 @@ private:
/** /**
* Decompresses data to ensure that buffer has newSize bytes or end of stream was reached * Decompresses data to ensure that buffer has newSize bytes or end of stream was reached
*/ */
si64 readMore(ui8 * data, si64 size); si64 readMore(ui8 * data, si64 size) override;
/** The file stream with compressed data. */ /** The file stream with compressed data. */
std::unique_ptr<CInputStream> gzipStream; std::unique_ptr<CInputStream> gzipStream;

View File

@ -117,18 +117,18 @@ public:
} skillsInfo; } skillsInfo;
//int3 getSightCenter() const; //"center" tile from which the sight distance is calculated //int3 getSightCenter() const; //"center" tile from which the sight distance is calculated
int getSightRadious() const; //sight distance (should be used if player-owned structure) int getSightRadious() const override; //sight distance (should be used if player-owned structure)
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int getBoatType() const; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed void getOutOffsets(std::vector<int3> &offsets) const override; //offsets to obj pos when we boat can be placed
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
bool hasSpellbook() const; bool hasSpellbook() const;
EAlignment::EAlignment getAlignment() const; EAlignment::EAlignment getAlignment() const;
const std::string &getBiography() const; const std::string &getBiography() const;
bool needsLastStack()const; bool needsLastStack()const override;
ui32 getTileCost(const TerrainTile &dest, const TerrainTile &from) const; //move cost - applying pathfinding skill, road and terrain modifiers. NOT includes diagonal move penalty, last move levelling ui32 getTileCost(const TerrainTile &dest, const TerrainTile &from) const; //move cost - applying pathfinding skill, road and terrain modifiers. NOT includes diagonal move penalty, last move levelling
ui32 getLowestCreatureSpeed() const; ui32 getLowestCreatureSpeed() const;
int3 getPosition(bool h3m = false) const; //h3m=true - returns position of hero object; h3m=false - returns position of hero 'manifestation' int3 getPosition(bool h3m = false) const; //h3m=true - returns position of hero object; h3m=false - returns position of hero 'manifestation'
@ -177,7 +177,7 @@ public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void setType(si32 ID, si32 subID); void setType(si32 ID, si32 subID) override;
void initHero(); void initHero();
void initHero(HeroTypeID SUBID); void initHero(HeroTypeID SUBID);

View File

@ -76,7 +76,7 @@ class DLL_LINKAGE CGUniversity : public CGMarket
public: public:
std::vector<int> skills; //available skills std::vector<int> skills; //available skills
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const; std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const override;
void initObj() override;//set skills for trade void initObj() override;//set skills for trade
void onHeroVisit(const CGHeroInstance * h) const override; //open window void onHeroVisit(const CGHeroInstance * h) const override; //open window

View File

@ -203,21 +203,21 @@ public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
bool passableFor(PlayerColor color) const; bool passableFor(PlayerColor color) const override;
//int3 getSightCenter() const override; //"center" tile from which the sight distance is calculated //int3 getSightCenter() const override; //"center" tile from which the sight distance is calculated
int getSightRadious() const override; //returns sight distance int getSightRadious() const override; //returns sight distance
int getBoatType() const; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed. Parameter will be cleared void getOutOffsets(std::vector<int3> &offsets) const override; //offsets to obj pos when we boat can be placed. Parameter will be cleared
int getMarketEfficiency() const override; //=market count int getMarketEfficiency() const override; //=market count
bool allowsTrade(EMarketMode::EMarketMode mode) const; bool allowsTrade(EMarketMode::EMarketMode mode) const override;
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const; std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const override;
void setType(si32 ID, si32 subID); void setType(si32 ID, si32 subID) override;
void updateAppearance(); void updateAppearance();
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
bool needsLastStack() const; bool needsLastStack() const override;
CGTownInstance::EFortLevel fortLevel() const; CGTownInstance::EFortLevel fortLevel() const;
int hallLevel() const; // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol int hallLevel() const; // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol
int mageGuildLevel() const; // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol int mageGuildLevel() const; // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol

View File

@ -156,7 +156,7 @@ protected:
class DLL_LINKAGE CGKeymasterTent : public CGKeys class DLL_LINKAGE CGKeymasterTent : public CGKeys
{ {
public: public:
bool wasVisited (PlayerColor player) const; bool wasVisited (PlayerColor player) const override;
void onHeroVisit(const CGHeroInstance * h) const override; void onHeroVisit(const CGHeroInstance * h) const override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
@ -173,9 +173,9 @@ public:
void onHeroVisit(const CGHeroInstance * h) const override; void onHeroVisit(const CGHeroInstance * h) const override;
void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override; void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override;
void getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h = nullptr) const; void getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h = nullptr) const override;
void getRolloverText (MetaString &text, bool onHover) const; void getRolloverText (MetaString &text, bool onHover) const;
bool checkQuest (const CGHeroInstance * h) const; bool checkQuest (const CGHeroInstance * h) const override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {

View File

@ -39,16 +39,16 @@ protected:
public: public:
CDefaultObjectTypeHandler(){} CDefaultObjectTypeHandler(){}
CGObjectInstance * create(ObjectTemplate tmpl) const CGObjectInstance * create(ObjectTemplate tmpl) const override
{ {
return createTyped(tmpl); return createTyped(tmpl);
} }
virtual void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const virtual void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override
{ {
} }
virtual std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const virtual std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const override
{ {
return nullptr; return nullptr;
} }
@ -58,24 +58,24 @@ class CObstacleConstructor : public CDefaultObjectTypeHandler<CGObjectInstance>
{ {
public: public:
CObstacleConstructor(); CObstacleConstructor();
bool isStaticObject(); bool isStaticObject() override;
}; };
class CTownInstanceConstructor : public CDefaultObjectTypeHandler<CGTownInstance> class CTownInstanceConstructor : public CDefaultObjectTypeHandler<CGTownInstance>
{ {
JsonNode filtersJson; JsonNode filtersJson;
protected: protected:
bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const; bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const override;
void initTypeData(const JsonNode & input); void initTypeData(const JsonNode & input) override;
public: public:
CFaction * faction; CFaction * faction;
std::map<std::string, LogicalExpression<BuildingID>> filters; std::map<std::string, LogicalExpression<BuildingID>> filters;
CTownInstanceConstructor(); CTownInstanceConstructor();
CGObjectInstance * create(ObjectTemplate tmpl) const; CGObjectInstance * create(ObjectTemplate tmpl) const override;
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const; void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
void afterLoadFinalization(); void afterLoadFinalization() override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
@ -88,17 +88,17 @@ class CHeroInstanceConstructor : public CDefaultObjectTypeHandler<CGHeroInstance
{ {
JsonNode filtersJson; JsonNode filtersJson;
protected: protected:
bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const; bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const override;
void initTypeData(const JsonNode & input); void initTypeData(const JsonNode & input) override;
public: public:
CHeroClass * heroClass; CHeroClass * heroClass;
std::map<std::string, LogicalExpression<HeroTypeID>> filters; std::map<std::string, LogicalExpression<HeroTypeID>> filters;
CHeroInstanceConstructor(); CHeroInstanceConstructor();
CGObjectInstance * create(ObjectTemplate tmpl) const; CGObjectInstance * create(ObjectTemplate tmpl) const override;
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const; void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
void afterLoadFinalization(); void afterLoadFinalization() override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {
@ -114,14 +114,14 @@ class CDwellingInstanceConstructor : public CDefaultObjectTypeHandler<CGDwelling
JsonNode guards; JsonNode guards;
protected: protected:
bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const; bool objectFilter(const CGObjectInstance *, const ObjectTemplate &) const override;
void initTypeData(const JsonNode & input); void initTypeData(const JsonNode & input) override;
public: public:
CDwellingInstanceConstructor(); CDwellingInstanceConstructor();
CGObjectInstance * create(ObjectTemplate tmpl) const; CGObjectInstance * create(ObjectTemplate tmpl) const override;
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const; void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
bool producesCreature(const CCreature * crea) const; bool producesCreature(const CCreature * crea) const;
std::vector<const CCreature *> getProducedCreatures() const; std::vector<const CCreature *> getProducedCreatures() const;
@ -163,13 +163,13 @@ public:
TPossibleGuards getPossibleGuards() const; TPossibleGuards getPossibleGuards() const;
// These functions should try to evaluate minimal possible/max possible guards to give provide information on possible thread to AI // These functions should try to evaluate minimal possible/max possible guards to give provide information on possible thread to AI
CArmyStructure minGuards() const; CArmyStructure minGuards() const override;
CArmyStructure maxGuards() const; CArmyStructure maxGuards() const override;
bool givesResources() const; bool givesResources() const override;
bool givesArtifacts() const; bool givesArtifacts() const override;
bool givesCreatures() const; bool givesCreatures() const override;
bool givesSpells() const; bool givesSpells() const override;
}; };
class CBankInstanceConstructor : public CDefaultObjectTypeHandler<CBank> class CBankInstanceConstructor : public CDefaultObjectTypeHandler<CBank>
@ -178,7 +178,7 @@ class CBankInstanceConstructor : public CDefaultObjectTypeHandler<CBank>
JsonVector levels; JsonVector levels;
protected: protected:
void initTypeData(const JsonNode & input); void initTypeData(const JsonNode & input) override;
public: public:
// all banks of this type will be reset N days after clearing, // all banks of this type will be reset N days after clearing,
@ -186,10 +186,10 @@ public:
CBankInstanceConstructor(); CBankInstanceConstructor();
CGObjectInstance *create(ObjectTemplate tmpl) const; CGObjectInstance *create(ObjectTemplate tmpl) const override;
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const; void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const; std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const override;
template <typename Handler> void serialize(Handler &h, const int version) template <typename Handler> void serialize(Handler &h, const int version)
{ {

View File

@ -19,7 +19,7 @@ class DLL_LINKAGE CPlayersVisited: public CGObjectInstance
public: public:
std::set<PlayerColor> players; //players that visited this object std::set<PlayerColor> players; //players that visited this object
bool wasVisited(PlayerColor player) const; bool wasVisited(PlayerColor player) const override;
bool wasVisited(TeamID team) const; bool wasVisited(TeamID team) const;
void setPropertyDer(ui8 what, ui32 val) override; void setPropertyDer(ui8 what, ui32 val) override;
@ -394,7 +394,7 @@ public:
class CGShipyard : public CGObjectInstance, public IShipyard class CGShipyard : public CGObjectInstance, public IShipyard
{ {
public: public:
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed void getOutOffsets(std::vector<int3> &offsets) const override; //offsets to obj pos when we boat can be placed
CGShipyard(); CGShipyard();
void onHeroVisit(const CGHeroInstance * h) const override; void onHeroVisit(const CGHeroInstance * h) const override;

View File

@ -50,14 +50,14 @@ public:
* *
* @return a unique ptr of the loaded map class * @return a unique ptr of the loaded map class
*/ */
std::unique_ptr<CMap> loadMap(); std::unique_ptr<CMap> loadMap() override;
/** /**
* Loads the VCMI/H3 map header. * Loads the VCMI/H3 map header.
* *
* @return a unique ptr of the loaded map header class * @return a unique ptr of the loaded map header class
*/ */
std::unique_ptr<CMapHeader> loadMapHeader(); std::unique_ptr<CMapHeader> loadMapHeader() override;
/** true if you want to enable the map loader profiler to see how long a specific part took; default=false */ /** true if you want to enable the map loader profiler to see how long a specific part took; default=false */
static const bool IS_PROFILING_ENABLED; static const bool IS_PROFILING_ENABLED;

View File

@ -31,20 +31,20 @@ public:
* *
* @return a unique ptr of the loaded map class * @return a unique ptr of the loaded map class
*/ */
std::unique_ptr<CMap> loadMap(); std::unique_ptr<CMap> loadMap() override;
/** /**
* Loads the VCMI/Json map header. * Loads the VCMI/Json map header.
* *
* @return a unique ptr of the loaded map header class * @return a unique ptr of the loaded map header class
*/ */
std::unique_ptr<CMapHeader> loadMapHeader(); std::unique_ptr<CMapHeader> loadMapHeader() override;
/** /**
* Modifies supplied map header using Json data * Modifies supplied map header using Json data
* *
*/ */
void patchMapHeader(std::unique_ptr<CMapHeader> & header); void patchMapHeader(std::unique_ptr<CMapHeader> & header) override;
private: private:
/** /**

View File

@ -28,12 +28,12 @@ public:
const std::map<std::string, CRmgTemplate *> & getTemplates() const; const std::map<std::string, CRmgTemplate *> & getTemplates() const;
std::vector<bool> getDefaultAllowed() const; std::vector<bool> getDefaultAllowed() const override;
std::vector<JsonNode> loadLegacyData(size_t dataSize); std::vector<JsonNode> loadLegacyData(size_t dataSize) override;
/// loads single object into game. Scope is namespace of this object, same as name of source mod /// loads single object into game. Scope is namespace of this object, same as name of source mod
virtual void loadObject(std::string scope, std::string name, const JsonNode & data); virtual void loadObject(std::string scope, std::string name, const JsonNode & data) override;
virtual void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index); virtual void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
private: private:
CRmgTemplate::CSize parseMapTemplateSize(const std::string & text) const; CRmgTemplate::CSize parseMapTemplateSize(const std::string & text) const;

View File

@ -250,7 +250,7 @@ public:
void sendMessageToAll(const std::string &message); void sendMessageToAll(const std::string &message);
void sendMessageTo(CConnection &c, const std::string &message); void sendMessageTo(CConnection &c, const std::string &message);
void sendToAllClients(CPackForClient * info); void sendToAllClients(CPackForClient * info);
void sendAndApply(CPackForClient * info); void sendAndApply(CPackForClient * info) override;
void applyAndSend(CPackForClient * info); void applyAndSend(CPackForClient * info);
void sendAndApply(CGarrisonOperationPack * info); void sendAndApply(CGarrisonOperationPack * info);
void sendAndApply(SetResource * info); void sendAndApply(SetResource * info);

View File

@ -94,7 +94,7 @@ public:
bool visitDestAfterVictory; //if hero moved to guarded tile and it should be visited once guard is defeated bool visitDestAfterVictory; //if hero moved to guarded tile and it should be visited once guard is defeated
const CGHeroInstance *hero; const CGHeroInstance *hero;
virtual void onExposure(CGameHandler *gh, QueryPtr topQuery); virtual void onExposure(CGameHandler *gh, QueryPtr topQuery) override;
CHeroMovementQuery(const TryMoveHero &Tmh, const CGHeroInstance *Hero, bool VisitDestAfterVictory = false); CHeroMovementQuery(const TryMoveHero &Tmh, const CGHeroInstance *Hero, bool VisitDestAfterVictory = false);
virtual void onAdding(CGameHandler *gh, PlayerColor color) override; virtual void onAdding(CGameHandler *gh, PlayerColor color) override;