summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-22 01:41:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-22 01:41:50 +0300
commit147696620522270d51d15ff3fd1e7e2431ff61ae (patch)
tree60e1657fcb1de2c29164aa0a3763e521f26bec65 /src
parent42c0ad1606c1169422b0baba3b4d4ba1d1129d36 (diff)
downloadmanaverse-147696620522270d51d15ff3fd1e7e2431ff61ae.tar.gz
manaverse-147696620522270d51d15ff3fd1e7e2431ff61ae.tar.bz2
manaverse-147696620522270d51d15ff3fd1e7e2431ff61ae.tar.xz
manaverse-147696620522270d51d15ff3fd1e7e2431ff61ae.zip
Move some getters in being class from cpp to h.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp52
-rw-r--r--src/being.h41
2 files changed, 35 insertions, 58 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 892be44b1..924ffd9e0 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -357,38 +357,6 @@ ActorSprite::TargetCursorSize Being::getTargetCursorSize() const
return mInfo->getTargetCursorSize();
}
-int Being::getTargetOffsetX() const
-{
- if (!mInfo)
- return 0;
-
- return mInfo->getTargetOffsetX();
-}
-
-int Being::getTargetOffsetY() const
-{
- if (!mInfo)
- return 0;
-
- return mInfo->getTargetOffsetY();
-}
-
-unsigned char Being::getWalkMask() const
-{
- if (!mInfo)
- return 0;
-
- return mInfo->getWalkMask();
-}
-
-Map::BlockType Being::getBlockType() const
-{
- if (!mInfo)
- return Map::BLOCKTYPE_NONE;
-
- return mInfo->getBlockType();
-}
-
void Being::setPosition(const Vector &pos)
{
Actor::setPosition(pos);
@@ -1222,12 +1190,6 @@ void Being::nextTile()
mActionTime += static_cast<int>(mWalkSpeed.x / 10);
}
-int Being::getCollisionRadius() const
-{
- // FIXME: Get this from XML file
- return 16;
-}
-
void Being::logic()
{
// Reduce the time that speech is still displayed
@@ -1491,8 +1453,8 @@ void Being::drawSpeech(int offsetX, int offsetY)
if (!mText && userPalette)
{
mText = new Text(mSpeech, getPixelX(), getPixelY() - getHeight(),
- gcn::Graphics::CENTER, &userPalette->getColor(
- UserPalette::PARTICLE), true);
+ gcn::Graphics::CENTER, &Theme::getThemeColor(
+ Theme::BUBBLE_TEXT), true);
}
}
else if (speech == NO_SPEECH)
@@ -1817,11 +1779,6 @@ void Being::setSpriteColor(unsigned int slot, const std::string &color)
setSprite(slot, mSpriteIDs[slot], color);
}
-int Being::getNumberOfLayers() const
-{
- return CompoundSprite::getNumberOfLayers();
-}
-
void Being::load()
{
// Hairstyles are encoded as negative numbers. Count how far negative
@@ -1997,11 +1954,6 @@ void Being::setGM(bool gm)
updateColors();
}
-bool Being::canTalk()
-{
- return mType == NPC;
-}
-
void Being::talkTo()
{
if (!Client::limitPackets(PACKET_NPC_TALK))
diff --git a/src/being.h b/src/being.h
index 725163d9c..289c15e9d 100644
--- a/src/being.h
+++ b/src/being.h
@@ -30,6 +30,8 @@
#include "position.h"
#include "vector.h"
+#include "resources/beinginfo.h"
+
#include <guichan/color.hpp>
#include <SDL_types.h>
@@ -47,7 +49,7 @@
class AnimatedSprite;
class BeingCacheEntry;
class Being;
-class BeingInfo;
+//class BeingInfo;
class FlashText;
class Guild;
class Inventory;
@@ -389,7 +391,8 @@ class Being : public ActorSprite, public ConfigListener
/**
* Get the number of layers used to draw the being
*/
- int getNumberOfLayers() const;
+ int getNumberOfLayers() const
+ { return CompoundSprite::getNumberOfLayers(); }
/**
* Performs being logic.
@@ -419,19 +422,39 @@ class Being : public ActorSprite, public ConfigListener
TargetCursorSize getTargetCursorSize() const;
- int getTargetOffsetX() const;
+ int getTargetOffsetX() const
+ {
+ if (!mInfo)
+ return 0;
+ return mInfo->getTargetOffsetX();
+ }
- int getTargetOffsetY() const;
+ int getTargetOffsetY() const
+ {
+ if (!mInfo)
+ return 0;
+ return mInfo->getTargetOffsetY();
+ }
/**
* Gets the way the object is blocked by other objects.
*/
- virtual unsigned char getWalkMask() const;
+ virtual unsigned char getWalkMask() const
+ {
+ if (!mInfo)
+ return 0;
+ return mInfo->getWalkMask();
+ }
/**
* Gets the way the monster blocks pathfinding for other objects
*/
- Map::BlockType getBlockType() const;
+ Map::BlockType getBlockType() const
+ {
+ if (!mInfo)
+ return Map::BLOCKTYPE_NONE;
+ return mInfo->getBlockType();
+ }
/**
* Sets the walk speed.
@@ -526,7 +549,8 @@ class Being : public ActorSprite, public ConfigListener
/**
* Returns the being's pixel radius used to detect collisions.
*/
- virtual int getCollisionRadius() const;
+ virtual int getCollisionRadius() const
+ { return 16; }
/**
* Shoots a missile particle from this being, to target being
@@ -628,7 +652,8 @@ class Being : public ActorSprite, public ConfigListener
*/
void setGM(bool gm);
- bool canTalk();
+ bool canTalk()
+ { return mType == NPC; }
void talkTo();