diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-11-13 12:05:43 +0100 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-11-13 12:05:43 +0100 |
commit | 3293d06b364bc91348f6a305f97e607ff610eb98 (patch) | |
tree | 25b5c0801cb96208c225121a7a18c9d896ba5ac6 /src/graphics/animation.cpp | |
parent | c8663de4fbdb30534723df6c8d1331535dcdadc2 (diff) |
Make animations use runtime polimorphism:
Lets us make different animation types but use them interchangeably
Diffstat (limited to 'src/graphics/animation.cpp')
-rw-r--r-- | src/graphics/animation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/graphics/animation.cpp b/src/graphics/animation.cpp index b93387e..577324a 100644 --- a/src/graphics/animation.cpp +++ b/src/graphics/animation.cpp @@ -64,6 +64,10 @@ namespace Graphics{ rect_.top = row_ * h_; } + bool Animation::finished(){ + return false; + } + Animation::~Animation(){} // ONESHOT ANIMATION @@ -75,7 +79,7 @@ namespace Graphics{ } bool OneShotAnimation::finished(){ - return i_ == count_ - 1; + return (i_ == count_ - 1); } sf::IntRect& OneShotAnimation::next(int deltaTime){ |