diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/compoundsprite.h | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/compoundsprite.h')
-rw-r--r-- | src/compoundsprite.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/compoundsprite.h b/src/compoundsprite.h index eed40231..e5b41973 100644 --- a/src/compoundsprite.h +++ b/src/compoundsprite.h @@ -32,43 +32,43 @@ class CompoundSprite : public Sprite public: CompoundSprite(); - ~CompoundSprite(); + ~CompoundSprite() override; - virtual bool reset(); + bool reset() override; - virtual bool play(std::string action); + bool play(std::string action) override; - virtual bool update(int time); + bool update(int time) override; - virtual bool draw(Graphics *graphics, int posX, int posY) const; + bool draw(Graphics *graphics, int posX, int posY) const override; /** * Gets the width in pixels of the first sprite in the list. */ - virtual int getWidth() const + int getWidth() const override { return mWidth; } /** * Gets the height in pixels of the first sprite in the list. */ - virtual int getHeight() const + int getHeight() const override { return mHeight; } - int getOffsetX() const + int getOffsetX() const override { return mOffsetX; } - int getOffsetY() const + int getOffsetY() const override { return mOffsetY; } - virtual const Image *getImage() const; + const Image *getImage() const override; - virtual bool setDirection(SpriteDirection direction); + bool setDirection(SpriteDirection direction) override; int getNumberOfLayers() const; virtual bool drawnWhenBehind() const; - int getDuration() const; + int getDuration() const override; size_t size() const { return mSprites.size(); } @@ -90,8 +90,8 @@ public: { mNeedsRedraw = true; } private: - typedef std::vector<Sprite*>::iterator SpriteIterator; - typedef std::vector<Sprite*>::const_iterator SpriteConstIterator; + using SpriteIterator = std::vector<Sprite *>::iterator; + using SpriteConstIterator = std::vector<Sprite *>::const_iterator; void redraw() const; |