diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-23 16:02:00 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-23 16:02:00 +0000 |
commit | 05a12d5568111fa13759026442ed358605bf9a28 (patch) | |
tree | 9948a2351c846dee1b36f25a90d1429aa78dda23 /src/being.h | |
parent | 3737fb9fd3ff6072f83bdc514f88ad0fdbf4da6c (diff) | |
download | mana-05a12d5568111fa13759026442ed358605bf9a28.tar.gz mana-05a12d5568111fa13759026442ed358605bf9a28.tar.bz2 mana-05a12d5568111fa13759026442ed358605bf9a28.tar.xz mana-05a12d5568111fa13759026442ed358605bf9a28.zip |
A bunch of mostly cosmetic cleanups.
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 10 |
1 files changed, 8 insertions, 2 deletions
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_NODE> 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 */ |