From 9daf4b373d3b4a0b40f4c88d46ac66603b53113d Mon Sep 17 00:00:00 2001 From: zvon Date: Mon, 24 Aug 2020 16:33:53 +0200 Subject: [PATCH] Mark getPos as const --- sdlpp.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdlpp.hpp b/sdlpp.hpp index 97be992..aee0531 100644 --- a/sdlpp.hpp +++ b/sdlpp.hpp @@ -306,7 +306,7 @@ public: std::pair< double, double > > getDoubleRect() = 0; virtual void setPos( double x, double y ) = 0; - virtual std::pair< double, double > getPos() = 0; + virtual std::pair< double, double > getPos() const = 0; bool colidesWith( const RenderObject &other ) const { if ( !hasCollisions() || !other.hasCollisions() || getHidden() || other.getHidden() ) { @@ -881,7 +881,7 @@ public: og_y = y; updateSizeAndPosition(); } - virtual std::pair< double, double > getPos() override { + virtual std::pair< double, double > getPos() const override { return { og_x, og_y }; } virtual int leftmost() override {