From 05a12d5568111fa13759026442ed358605bf9a28 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Thu, 23 Feb 2006 16:02:00 +0000 Subject: A bunch of mostly cosmetic cleanups. --- src/being.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/being.h') diff --git a/src/being.h b/src/being.h index 45cfb15d..db6afbb8 100644 --- a/src/being.h +++ b/src/being.h @@ -278,13 +278,13 @@ class Being : public Sprite * Get the current X pixel offset. */ int - getXOffset() const; + getXOffset() const { return getOffset(LEFT, RIGHT); } /** * Get the current Y pixel offset. */ int - getYOffset() const; + getYOffset() const { return getOffset(UP, DOWN); } protected: /** @@ -293,6 +293,12 @@ class Being : public Sprite void setPath(std::list path); + /** + * Calculates the offset in the given directions. + * If walking in direction 'neg' the value is negated. + */ + int getOffset(char pos, char neg) const; + Uint32 mId; /**< Unique sprite id */ Uint16 mWeapon; /**< Weapon picture id */ Uint16 mWalkSpeed; /**< Walking speed */ -- cgit v1.2.3-70-g09d2