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/particle.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/particle.h')
-rw-r--r-- | src/particle.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/particle.h b/src/particle.h index 18deb5c7..24ab74ce 100644 --- a/src/particle.h +++ b/src/particle.h @@ -33,10 +33,10 @@ class Map; class Particle; class ParticleEmitter; -typedef std::list<Particle *> Particles; -typedef Particles::iterator ParticleIterator; -typedef std::list<ParticleEmitter *> Emitters; -typedef Emitters::iterator EmitterIterator; +using Particles = std::list<Particle *>; +using ParticleIterator = Particles::iterator; +using Emitters = std::list<ParticleEmitter *>; +using EmitterIterator = Emitters::iterator; /** * A particle spawned by a ParticleEmitter. @@ -68,7 +68,7 @@ class Particle : public Actor */ Particle(Map *map); - ~Particle(); + ~Particle() override; /** * Deletes all child particles and emitters. @@ -90,12 +90,12 @@ class Particle : public Actor /** * Draws the particle image. */ - virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const; + bool draw(Graphics *graphics, int offsetX, int offsetY) const override; /** * Do not draw particles when beind other objects */ - virtual bool drawnWhenBehind() const + bool drawnWhenBehind() const override { return false; } /** @@ -251,13 +251,13 @@ class Particle : public Actor { mAutoDelete = false; } /** We consider particles (at least for now) to be one layer-sprites */ - virtual int getNumberOfLayers() const + int getNumberOfLayers() const override { return 1; } - virtual float getAlpha() const + float getAlpha() const override { return 1.0f; } - virtual void setAlpha(float alpha) {} + void setAlpha(float alpha) override {} virtual void setDeathEffect(const std::string &effectFile, char conditions) { mDeathEffect = effectFile; mDeathEffectConditions = conditions; } |