summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-03 18:59:37 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-03 19:03:30 +0300
commit98db78be9552b039090ce5dfc53803df2dd54b41 (patch)
treeefda1a43723e8e11e075dcfef2776fe38c7cb3da /src
parentd7cbb663f5f8e19ccfa7162ef7d1d4e3b4020335 (diff)
downloadmv-98db78be9552b039090ce5dfc53803df2dd54b41.tar.gz
mv-98db78be9552b039090ce5dfc53803df2dd54b41.tar.bz2
mv-98db78be9552b039090ce5dfc53803df2dd54b41.tar.xz
mv-98db78be9552b039090ce5dfc53803df2dd54b41.zip
Add some missing getters.
Diffstat (limited to 'src')
-rw-r--r--src/actorspritemanager.h22
-rw-r--r--src/animatedsprite.cpp2
-rw-r--r--src/animatedsprite.h4
-rw-r--r--src/being.h22
-rw-r--r--src/channel.h5
-rw-r--r--src/equipment.h2
-rw-r--r--src/flooritem.h2
-rw-r--r--src/game.h2
-rw-r--r--src/graphics.h14
-rw-r--r--src/gui/editdialog.h2
-rw-r--r--src/gui/equipmentwindow.h2
-rw-r--r--src/gui/inventorywindow.h2
-rw-r--r--src/gui/npcdialog.h3
-rw-r--r--src/gui/outfitwindow.h2
-rw-r--r--src/gui/palette.h10
-rw-r--r--src/gui/serverdialog.h1
-rw-r--r--src/gui/shopwindow.h2
-rw-r--r--src/gui/skilldialog.h2
-rw-r--r--src/gui/socialwindow.h4
-rw-r--r--src/gui/statuswindow.cpp6
-rw-r--r--src/gui/theme.h2
-rw-r--r--src/gui/tradewindow.h2
-rw-r--r--src/gui/userpalette.h2
-rw-r--r--src/gui/viewport.h10
-rw-r--r--src/gui/whoisonline.h2
-rw-r--r--src/gui/widgets/browserbox.h2
-rw-r--r--src/gui/widgets/button.h6
-rw-r--r--src/gui/widgets/channeltab.h3
-rw-r--r--src/gui/widgets/chattab.h8
-rw-r--r--src/gui/widgets/guildchattab.h3
-rw-r--r--src/gui/widgets/icon.h3
-rw-r--r--src/gui/widgets/layout.h4
-rw-r--r--src/gui/widgets/popup.h18
-rw-r--r--src/gui/widgets/progressbar.h6
-rw-r--r--src/gui/widgets/scrollarea.h3
-rw-r--r--src/gui/widgets/setupitem.h4
-rw-r--r--src/gui/widgets/setuptabscroll.h2
-rw-r--r--src/gui/widgets/shoplistbox.h3
-rw-r--r--src/gui/widgets/tab.h4
-rw-r--r--src/gui/widgets/tabbedarea.h4
-rw-r--r--src/guild.h2
-rw-r--r--src/guildmanager.h2
-rw-r--r--src/localplayer.h60
-rw-r--r--src/map.cpp2
-rw-r--r--src/map.h25
-rw-r--r--src/net/manaserv/attributes.cpp8
-rw-r--r--src/net/manaserv/connection.h2
-rw-r--r--src/net/manaserv/gamehandler.h6
-rw-r--r--src/net/manaserv/guildhandler.h2
-rw-r--r--src/particle.h2
-rw-r--r--src/resources/action.h2
-rw-r--r--src/resources/image.h8
-rw-r--r--src/resources/imageset.h4
-rw-r--r--src/resources/iteminfo.h5
-rw-r--r--src/resources/resource.h2
-rw-r--r--src/resources/resourcemanager.h6
-rw-r--r--src/sound.h2
-rw-r--r--src/textcommand.h2
58 files changed, 181 insertions, 163 deletions
diff --git a/src/actorspritemanager.h b/src/actorspritemanager.h
index 7960c6301..a78e3ad49 100644
--- a/src/actorspritemanager.h
+++ b/src/actorspritemanager.h
@@ -231,10 +231,10 @@ class ActorSpriteManager: public ConfigListener
void addIgnoreAttackMob(std::string name);
- std::list<std::string> getPriorityAttackMobs()
+ std::list<std::string> getPriorityAttackMobs() const
{ return mPriorityAttackMobs; }
- std::list<std::string> getAttackMobs()
+ std::list<std::string> getAttackMobs() const
{ return mAttackMobs; }
void setPriorityAttackMobs(std::list<std::string> mobs)
@@ -243,29 +243,29 @@ class ActorSpriteManager: public ConfigListener
void setAttackMobs(std::list<std::string> mobs)
{ mAttackMobs = mobs; }
- int getPriorityAttackMobsSize()
+ int getPriorityAttackMobsSize() const
{ return mPriorityAttackMobs.size(); }
- int getAttackMobsSize()
+ int getAttackMobsSize() const
{ return mAttackMobs.size(); }
- std::list<std::string> getIgnoreAttackMobs()
+ std::list<std::string> getIgnoreAttackMobs() const
{ return mIgnoreAttackMobs; }
- std::set<std::string> getAttackMobsSet()
+ std::set<std::string> getAttackMobsSet() const
{ return mAttackMobsSet; }
- std::set<std::string> getPriorityAttackMobsSet()
+ std::set<std::string> getPriorityAttackMobsSet() const
{ return mPriorityAttackMobsSet; }
- std::set<std::string> getIgnoreAttackMobsSet()
+ std::set<std::string> getIgnoreAttackMobsSet() const
{ return mIgnoreAttackMobsSet; }
void rebuildPriorityAttackMobs();
void rebuildAttackMobs();
- bool isInAttackList(const std::string &name)
+ bool isInAttackList(const std::string &name) const
{ return mAttackMobsSet.find(name) != mAttackMobsSet.end(); }
bool isInPriorityAttackList(const std::string &name)
@@ -280,10 +280,10 @@ class ActorSpriteManager: public ConfigListener
!= mIgnoreAttackMobsSet.end();
}
- std::map<std::string, int> getAttackMobsMap()
+ std::map<std::string, int> getAttackMobsMap() const
{ return mAttackMobsMap; }
- std::map<std::string, int> getPriorityAttackMobsMap()
+ std::map<std::string, int> getPriorityAttackMobsMap() const
{ return mPriorityAttackMobsMap; }
int getAttackMobIndex(std::string name);
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index f4f3451cb..11329b321 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -285,7 +285,7 @@ int AnimatedSprite::getHeight() const
return 0;
}
-std::string AnimatedSprite::getIdPath()
+std::string AnimatedSprite::getIdPath() const
{
if (!mSprite)
return "";
diff --git a/src/animatedsprite.h b/src/animatedsprite.h
index 4a41eac52..d28badfc1 100644
--- a/src/animatedsprite.h
+++ b/src/animatedsprite.h
@@ -71,10 +71,10 @@ class AnimatedSprite : public Sprite
bool setSpriteDirection(SpriteDirection direction);
- int getNumberOfLayers()
+ int getNumberOfLayers() const
{ return 1; }
- std::string getIdPath();
+ std::string getIdPath() const;
unsigned int getCurrentFrame() const;
diff --git a/src/being.h b/src/being.h
index f34c192cb..8b3db1919 100644
--- a/src/being.h
+++ b/src/being.h
@@ -489,7 +489,7 @@ class Being : public ActorSprite, public ConfigListener
virtual void setDirectionDelayed(Uint8 direction)
{ mDirectionDelayed = direction; }
- Uint8 getDirectionDelayed()
+ Uint8 getDirectionDelayed() const
{ return mDirectionDelayed; }
/**
@@ -588,7 +588,7 @@ class Being : public ActorSprite, public ConfigListener
void setIsReachable(int n)
{ mIsReachable = n; }
- int isReachable()
+ int isReachable() const
{ return mIsReachable; }
static void reReadConfig();
@@ -681,7 +681,7 @@ class Being : public ActorSprite, public ConfigListener
void setMaxHP(int hp);
- int getHP()
+ int getHP() const
{ return mHP; }
Uint8 calcDirection(int dstX, int dstY) const;
@@ -691,22 +691,22 @@ class Being : public ActorSprite, public ConfigListener
void setAttackDelay(int n)
{ mAttackDelay = n; }
- int getAttackDelay()
+ int getAttackDelay() const
{ return mAttackDelay; }
- int getMinHit()
+ int getMinHit() const
{ return mMinHit; }
void setMinHit(int n)
{ mMinHit = n; }
- int getMaxHit()
+ int getMaxHit() const
{ return mMaxHit; }
void setMaxHit(int n)
{ mMaxHit = n; }
- int getCriticalHit()
+ int getCriticalHit() const
{ return mCriticalHit; }
void setCriticalHit(int n)
@@ -718,7 +718,7 @@ class Being : public ActorSprite, public ConfigListener
void undressItemById(int id);
- int getGoodStatus()
+ int getGoodStatus() const
{ return mGoodStatus; }
void setGoodStatus(int n)
@@ -730,7 +730,7 @@ class Being : public ActorSprite, public ConfigListener
void updateComment();
- std::string getComment()
+ const std::string getComment() const
{ return mComment; }
void setComment(std::string n)
@@ -743,13 +743,13 @@ class Being : public ActorSprite, public ConfigListener
static void saveComment(const std::string &name,
const std::string &comment, int type);
- bool isAdvanced()
+ bool isAdvanced() const
{ return mAdvanced; }
void setAdvanced(bool n)
{ mAdvanced = n; addToCache(); }
- bool isShopEnabled()
+ bool isShopEnabled() const
{ return mShop; }
void enableShop(bool b)
diff --git a/src/channel.h b/src/channel.h
index 559002296..cf52743f0 100644
--- a/src/channel.h
+++ b/src/channel.h
@@ -46,7 +46,8 @@ class Channel
/**
* Get the id associated witht his channel.
*/
- int getId() const { return mId; }
+ int getId() const
+ { return mId; }
/**
* Get this channel's name.
@@ -72,7 +73,7 @@ class Channel
void setAnnouncement(const std::string &channelAnnouncement)
{ mAnnouncement = channelAnnouncement; }
- ChannelTab *getTab()
+ ChannelTab *getTab() const
{ return mTab; }
protected:
diff --git a/src/equipment.h b/src/equipment.h
index 6e4d04c21..50acd60d3 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -90,7 +90,7 @@ class Equipment
void setBackend(Backend *backend)
{ mBackend = backend; }
- Backend *getBackend()
+ Backend *getBackend() const
{ return mBackend; }
private:
diff --git a/src/flooritem.h b/src/flooritem.h
index 7e7da33a0..95427c252 100644
--- a/src/flooritem.h
+++ b/src/flooritem.h
@@ -83,7 +83,7 @@ class FloorItem : public ActorSprite
unsigned char getColor() const
{ return mColor; }
- bool getShowMsg()
+ bool getShowMsg() const
{ return mShowMsg; }
void setShowMsg(bool n)
diff --git a/src/game.h b/src/game.h
index 6064a300b..4469d3774 100644
--- a/src/game.h
+++ b/src/game.h
@@ -91,7 +91,7 @@ class Game
/**
* Returns the currently active map.
*/
- Map *getCurrentMap()
+ Map *getCurrentMap() const
{ return mCurrentMap; }
const std::string &getCurrentMapName() const
diff --git a/src/graphics.h b/src/graphics.h
index d1409be8a..5d496d654 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -225,7 +225,7 @@ class Graphics : public gcn::SDLGraphics
void setBlitMode(BlitMode mode)
{ mBlitMode = mode; }
- BlitMode getBlitMode()
+ BlitMode getBlitMode() const
{ return mBlitMode; }
void fillRectangle(const gcn::Rectangle& rectangle);
@@ -263,25 +263,25 @@ class Graphics : public gcn::SDLGraphics
void setRedraw(bool n)
{ mRedraw = n; }
- bool getRedraw()
+ bool getRedraw() const
{ return mRedraw; }
void setSecure(bool n)
{ mSecure = n; }
- bool getSecure()
+ bool getSecure() const
{ return mSecure; }
- int getBpp()
+ int getBpp() const
{ return mBpp; }
- bool getFullScreen()
+ bool getFullScreen() const
{ return mFullscreen; }
- bool getHWAccel()
+ bool getHWAccel() const
{ return mHWAccel; }
- bool getDoubleBuffer()
+ bool getDoubleBuffer() const
{ return mDoubleBuffer; }
int getOpenGL()
diff --git a/src/gui/editdialog.h b/src/gui/editdialog.h
index 69f86edca..ef260acfb 100644
--- a/src/gui/editdialog.h
+++ b/src/gui/editdialog.h
@@ -57,7 +57,7 @@ class EditDialog : public Window, public gcn::ActionListener
*/
void action(const gcn::ActionEvent &event);
- std::string getMsg()
+ std::string getMsg() const
{ return mTextField->getText(); }
private:
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h
index daeaeb3d7..1e7b84533 100644
--- a/src/gui/equipmentwindow.h
+++ b/src/gui/equipmentwindow.h
@@ -84,7 +84,7 @@ class EquipmentWindow : public Window, public gcn::ActionListener
void mousePressed(gcn::MouseEvent& mouseEvent);
- Item* getEquipment(int i)
+ Item* getEquipment(int i) const
{ return mEquipment ? mEquipment->getEquipment(i) : nullptr; }
void setBeing(Being *being);
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index 2b35ec9c4..9d4be5afc 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -115,7 +115,7 @@ class InventoryWindow : public Window,
void slotsChanged(Inventory* inventory);
- bool isMainInventory()
+ bool isMainInventory() const
{ return mInventory->isMainInventory(); }
/**
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h
index 4d919a3f2..d4288d5c9 100644
--- a/src/gui/npcdialog.h
+++ b/src/gui/npcdialog.h
@@ -154,7 +154,8 @@ class NpcDialog : public Window, public gcn::ActionListener,
/**
* Returns true if any instances exist.
*/
- static bool isActive() { return !instances.empty(); }
+ static bool isActive()
+ { return !instances.empty(); }
/**
* Returns the first active instance. Useful for pushing user
diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h
index a663f3657..6f67c472d 100644
--- a/src/gui/outfitwindow.h
+++ b/src/gui/outfitwindow.h
@@ -72,7 +72,7 @@ class OutfitWindow : public Window, gcn::ActionListener
void setItemSelected(Item *item);
- bool isItemSelected()
+ bool isItemSelected() const
{ return mItemSelected > 0; }
void wearOutfit(int outfit, bool unwearEmpty = true,
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 36d87e305..7d5d93830 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -98,9 +98,7 @@ class Palette
* @return the gradient type of the color with the given index
*/
inline GradientType getGradientType(int type) const
- {
- return mColors[type].grad;
- }
+ { return mColors[type].grad; }
/**
* Get the character used by the specified color.
@@ -110,9 +108,7 @@ class Palette
* @return the color char of the color with the given index
*/
inline char getColorChar(int type) const
- {
- return mColors[type].ch;
- }
+ { return mColors[type].ch; }
/**
* Gets the gradient delay for the specified type.
@@ -122,7 +118,7 @@ class Palette
* @return the gradient delay of the color with the given index
*/
inline int getGradientDelay(int type) const
- { return mColors[type].delay; }
+ { return mColors[type].delay; }
/**
* Updates all colors, that are non-static.
diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h
index 081535c4c..c23fb8776 100644
--- a/src/gui/serverdialog.h
+++ b/src/gui/serverdialog.h
@@ -127,6 +127,7 @@ class ServerDialog : public Window,
protected:
friend class ServersListModel;
+
MutexLocker lock()
{ return MutexLocker(&mMutex); }
diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h
index 53ed7690c..a8d131acb 100644
--- a/src/gui/shopwindow.h
+++ b/src/gui/shopwindow.h
@@ -109,7 +109,7 @@ class ShopWindow : public Window, public gcn::ActionListener,
void setAcceptPlayer(std::string name)
{ mAcceptPlayer = name; }
- const std::string &getAcceptPlayer()
+ const std::string &getAcceptPlayer() const
{ return mAcceptPlayer; }
void sendMessage(const std::string &nick, std::string data,
diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h
index dcb40927a..9032f82ef 100644
--- a/src/gui/skilldialog.h
+++ b/src/gui/skilldialog.h
@@ -77,7 +77,7 @@ class SkillDialog : public Window, public gcn::ActionListener
SkillInfo* getSkill(int id);
- bool hasSkills()
+ bool hasSkills() const
{ return !mSkills.empty(); }
void widgetResized(const gcn::Event &event);
diff --git a/src/gui/socialwindow.h b/src/gui/socialwindow.h
index 1429866ee..9da78562b 100644
--- a/src/gui/socialwindow.h
+++ b/src/gui/socialwindow.h
@@ -101,13 +101,13 @@ public:
void prevTab();
- Map* getMap()
+ Map* getMap() const
{ return mMap; }
void setMap(Map *map)
{ mMap = map; mProcessedPortals = false; }
- bool getProcessedPortals()
+ bool getProcessedPortals() const
{ return mProcessedPortals; }
void setProcessedPortals(int n)
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 57c81bc04..86964383a 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -69,7 +69,7 @@ class AttrDisplay : public Container
virtual std::string update();
- virtual Type getType()
+ virtual Type getType() const
{ return UNKNOWN; }
std::string getValue()
@@ -96,7 +96,7 @@ class DerDisplay : public AttrDisplay
public:
DerDisplay(int id, const std::string &name);
- virtual Type getType()
+ virtual Type getType() const
{ return DERIVED; }
};
@@ -107,7 +107,7 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener
std::string update();
- virtual Type getType()
+ virtual Type getType() const
{ return CHANGEABLE; }
void setPointsNeeded(int needed);
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 3be6882a3..9cb8f6180 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -95,7 +95,7 @@ class Skin
*/
void updateAlpha(float minimumOpacityAllowed = 0.0f);
- int getPadding()
+ int getPadding() const
{ return mPadding; }
int instances;
diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h
index b055c90ce..268d2f108 100644
--- a/src/gui/tradewindow.h
+++ b/src/gui/tradewindow.h
@@ -128,7 +128,7 @@ class TradeWindow : public Window, gcn::ActionListener, gcn::SelectionListener
void initTrade(std::string nick);
- std::string getAutoTradeNick()
+ std::string getAutoTradeNick() const
{ return mAutoAddToNick; }
bool checkItem(Item *item);
diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h
index cb0593fa7..6fba30abc 100644
--- a/src/gui/userpalette.h
+++ b/src/gui/userpalette.h
@@ -107,7 +107,7 @@ class UserPalette : public Palette, public gcn::ListModel
*
* @return the requested test color
*/
- inline const gcn::Color &getTestColor(int type)
+ inline const gcn::Color &getTestColor(int type) const
{ return mColors[type].testColor; }
/**
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 4ed80ed32..f3035b5df 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -218,13 +218,13 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
Map *getCurrentMap() const
{ return mMap; }
- int getDebugPath()
+ int getDebugPath() const
{ return mShowDebugPath; }
void setDebugPath(int n)
{ mShowDebugPath = n; }
- int getCameraMode()
+ int getCameraMode() const
{ return mCameraMode; }
/**
@@ -237,15 +237,15 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
*/
void cleanHoverItems();
- Map *getMap()
+ Map *getMap() const
{ return mMap; }
void moveCamera(int dx, int dy);
- int getCameraRelativeX()
+ int getCameraRelativeX() const
{ return mCameraRelativeX; }
- int getCameraRelativeY()
+ int getCameraRelativeY() const
{ return mCameraRelativeY; }
void setCameraRelativeX(int n)
diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h
index d2f0c30d0..dad51e857 100644
--- a/src/gui/whoisonline.h
+++ b/src/gui/whoisonline.h
@@ -68,7 +68,7 @@ class OnlinePlayer
char getLevel() const
{ return mLevel; }
- const std::string getText()
+ const std::string getText() const
{ return mText; }
void setText(std::string str);
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index ab3049c0b..d82ebd758 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -187,7 +187,7 @@ class BrowserBox : public gcn::Widget,
TextRows &getRows()
{ return mTextRows; }
- bool hasRows()
+ bool hasRows() const
{ return !mTextRows.empty(); }
void setAlwaysUpdate(bool n)
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index aed46bb55..560e46377 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -70,16 +70,16 @@ class Button : public gcn::Button, public gcn::WidgetListener
void setDescription(std::string text)
{ mDescription = text; }
- std::string getDescription()
+ std::string getDescription() const
{ return mDescription; }
- unsigned getClickCount()
+ unsigned getClickCount() const
{ return mClickCount; }
void setTag(int tag)
{ mTag = tag; }
- int getTag()
+ int getTag() const
{ return mTag; }
void widgetResized(const gcn::Event &event);
diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h
index 4b56d2e05..39702a696 100644
--- a/src/gui/widgets/channeltab.h
+++ b/src/gui/widgets/channeltab.h
@@ -34,7 +34,8 @@ class ChannelTab : public ChatTab
{
public:
- Channel *getChannel() const { return mChannel; }
+ Channel *getChannel() const
+ { return mChannel; }
void showHelp();
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index ddf10bf5e..912305a63 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -137,24 +137,24 @@ class ChatTab : public Tab
std::list<std::string> &getRows()
{ return mTextOutput->getRows(); }
- bool hasRows()
+ bool hasRows() const
{ return mTextOutput->hasRows(); }
void loadFromLogFile(std::string name);
- bool getAllowHighlight()
+ bool getAllowHighlight() const
{ return mAllowHightlight; }
void setAllowHighlight(bool n)
{ mAllowHightlight = n; }
- bool getRemoveNames()
+ bool getRemoveNames() const
{ return mRemoveNames; }
void setRemoveNames(bool n)
{ mRemoveNames = n; }
- bool getNoAway()
+ bool getNoAway() const
{ return mNoAway; }
void setNoAway(bool n)
diff --git a/src/gui/widgets/guildchattab.h b/src/gui/widgets/guildchattab.h
index bebdaa1f3..be6f4d034 100644
--- a/src/gui/widgets/guildchattab.h
+++ b/src/gui/widgets/guildchattab.h
@@ -41,7 +41,8 @@ class GuildChatTab : public ChatTab
void saveToLogFile(std::string &msg);
- int getType() const { return ChatTab::TAB_GUILD; }
+ int getType() const
+ { return ChatTab::TAB_GUILD; }
protected:
void handleInput(const std::string &msg);
diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h
index 6f05da3f7..98fee314a 100644
--- a/src/gui/widgets/icon.h
+++ b/src/gui/widgets/icon.h
@@ -48,7 +48,8 @@ class Icon : public gcn::Widget
/**
* Gets the current Image.
*/
- Image *getImage() const { return mImage; }
+ Image *getImage() const
+ { return mImage; }
/**
* Sets the image to display.
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 02fed43b5..046d09b59 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -266,10 +266,10 @@ class LayoutCell
void setType(int t)
{ mType = t; }
- int getWidth()
+ int getWidth() const
{ return mExtent[0]; }
- int getHeight()
+ int getHeight() const
{ return mExtent[1]; }
void setWidth(int w)
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 8ff21149a..5572abd03 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -94,28 +94,32 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMinWidth(int width);
- int getMinWidth() const { return mMinWidth; }
+ int getMinWidth() const
+ { return mMinWidth; }
/**
* Sets the minimum height of the popup.
*/
void setMinHeight(int height);
- int getMinHeight() const { return mMinHeight; }
+ int getMinHeight() const
+ { return mMinHeight; }
/**
* Sets the maximum width of the popup.
*/
void setMaxWidth(int width);
- int getMaxWidth() const { return mMaxWidth; }
+ int getMaxWidth() const
+ { return mMaxWidth; }
/**
* Sets the minimum height of the popup.
*/
void setMaxHeight(int height);
- int getMaxHeight() const { return mMaxHeight; }
+ int getMaxHeight() const
+ { return mMaxHeight; }
/**
* Gets the padding of the popup. The padding is the distance between
@@ -124,9 +128,11 @@ class Popup : public Container, public gcn::MouseListener,
* @return The padding of the popup.
* @see setPadding
*/
- int getPadding() const { return mPadding; }
+ int getPadding() const
+ { return mPadding; }
- void setPadding(int padding) { mPadding = padding; }
+ void setPadding(int padding)
+ { mPadding = padding; }
/**
* Sets the name of the popup. This is only useful for debug purposes.
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index 163310245..603df6157 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -73,7 +73,8 @@ class ProgressBar : public gcn::Widget, public gcn::WidgetListener
/**
* Returns the current progress.
*/
- float getProgress() const { return mProgress; }
+ float getProgress() const
+ { return mProgress; }
/**
* Change the ProgressPalette for this ProgressBar to follow or -1 to
@@ -89,7 +90,8 @@ class ProgressBar : public gcn::Widget, public gcn::WidgetListener
/**
* Returns the color of the progress bar.
*/
- const gcn::Color &getColor() const { return mColor; }
+ const gcn::Color &getColor() const
+ { return mColor; }
/**
* Sets the text shown on the progress bar.
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index 86902b5c9..582033071 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -89,7 +89,8 @@ class ScrollArea : public gcn::ScrollArea, public gcn::WidgetListener
/**
* Returns whether the widget draws its background or not.
*/
- bool isOpaque() const { return mOpaque; }
+ bool isOpaque() const
+ { return mOpaque; }
/**
* Called when the mouse moves in the widget area.
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index eb2680ede..71856d6e2 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -75,7 +75,7 @@ class SetupItem : public gcn::ActionListener
void setWidget(gcn::Widget *widget)
{ mWidget = widget; }
- gcn::Widget *getWidget()
+ gcn::Widget *getWidget() const
{ return mWidget; }
Configuration *getConfig();
@@ -93,7 +93,7 @@ class SetupItem : public gcn::ActionListener
virtual void externalUpdated(std::string eventName);
// virtual int add(ContainerPlacer &place, int x, int y, int width);
- bool isMainConfig()
+ bool isMainConfig() const
{ return mMainConfig; }
protected:
diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h
index 4ad1f464b..d471ecfbc 100644
--- a/src/gui/widgets/setuptabscroll.h
+++ b/src/gui/widgets/setuptabscroll.h
@@ -43,7 +43,7 @@ class SetupTabScroll : public SetupTab
void addControl(SetupItem *widget, std::string event);
- VertContainer *getContainer()
+ VertContainer *getContainer() const
{ return mContainer; }
virtual void apply();
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index 9b416d3a3..694fdb92e 100644
--- a/src/gui/widgets/shoplistbox.h
+++ b/src/gui/widgets/shoplistbox.h
@@ -56,7 +56,8 @@ class ShopListBox : public ListBox
/**
* Returns the height of a row.
*/
- unsigned int getRowHeight() const { return mRowHeight; }
+ unsigned int getRowHeight() const
+ { return mRowHeight; }
/**
* gives information about the current player's money
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index 40b46ede5..829689543 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -61,7 +61,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener
*/
void setFlash(int flash);
- int getFlash()
+ int getFlash() const
{ return mFlash; }
void widgetResized(const gcn::Event &event);
@@ -70,7 +70,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener
void setLabelFont(gcn::Font *font);
- gcn::Label *getLabel()
+ gcn::Label *getLabel() const
{ return mLabel; }
protected:
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index b202dfc9d..cceaf56b7 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -136,13 +136,13 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener
void setRightMargin(int n)
{ mRightMargin = n; }
- int getRightMargin()
+ int getRightMargin() const
{ return mRightMargin; }
void setFollowDownScroll(bool n)
{ mFollowDownScroll = n; }
- bool getFollowDownScroll()
+ bool getFollowDownScroll() const
{ return mFollowDownScroll; }
void fixSize()
diff --git a/src/guild.h b/src/guild.h
index e95677ec6..8715c2907 100644
--- a/src/guild.h
+++ b/src/guild.h
@@ -43,7 +43,7 @@ public:
Guild *getGuild() const
{ return mGuild; }
- int getPos()
+ int getPos() const
{ return mPos; }
void setPos(int pos)
diff --git a/src/guildmanager.h b/src/guildmanager.h
index 368b2456c..b415d85e8 100644
--- a/src/guildmanager.h
+++ b/src/guildmanager.h
@@ -74,7 +74,7 @@ class GuildManager
bool afterRemove();
- bool havePower()
+ bool havePower() const
{ return mHavePower; }
private:
diff --git a/src/localplayer.h b/src/localplayer.h
index ede073abf..a7ce3dd7f 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -139,7 +139,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void setGMLevel(int level);
- int getGMLevel()
+ int getGMLevel() const
{ return mGMLevel; }
void stopAttack();
@@ -217,7 +217,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
bool isPathSetByMouse() const
{ return mPathSetByMouse; }
- int getInvertDirection()
+ int getInvertDirection() const
{ return mInvertDirection; }
void setInvertDirection(int n)
@@ -225,16 +225,16 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void invertDirection();
- int getAttackWeaponType()
+ int getAttackWeaponType() const
{ return mAttackWeaponType; }
- int getAttackType()
+ int getAttackType() const
{ return mAttackType; }
- int getFollowMode()
+ int getFollowMode() const
{ return mFollowMode; }
- int getImitationMode()
+ int getImitationMode() const
{ return mImitationMode; }
void changeAttackWeaponType();
@@ -247,41 +247,41 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void changePickUpType();
- int getCrazyMoveType()
- { return mCrazyMoveType ; }
+ int getCrazyMoveType() const
+ { return mCrazyMoveType; }
- int getPickUpType()
- { return mPickUpType ; }
+ int getPickUpType() const
+ { return mPickUpType; }
- int getQuickDropCounter()
- { return mQuickDropCounter ; }
+ int getQuickDropCounter() const
+ { return mQuickDropCounter; }
void changeQuickDropCounter();
- int getMoveState()
- { return mMoveState ; }
+ int getMoveState() const
+ { return mMoveState; }
void setMoveState(int n)
- { mMoveState = n ; }
+ { mMoveState = n; }
void switchMagicAttack();
void switchPvpAttack();
- int getMagicAttackType()
- { return mMagicAttackType ; }
+ int getMagicAttackType() const
+ { return mMagicAttackType; }
- int getPvpAttackType()
- { return mPvpAttackType ; }
+ int getPvpAttackType() const
+ { return mPvpAttackType; }
- int getMoveToTargetType()
- { return mMoveToTargetType ; }
+ int getMoveToTargetType() const
+ { return mMoveToTargetType; }
- int getDisableGameModifiers()
- { return mDisableGameModifiers ; }
+ int getDisableGameModifiers() const
+ { return mDisableGameModifiers; }
- int getPingTime()
- { return mPingTime ; }
+ int getPingTime() const
+ { return mPingTime; }
void tryPingRequest();
@@ -329,16 +329,16 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void setPseudoAway(const std::string &message);
- bool getAway()
+ bool getAway() const
{ return mAwayMode; }
- bool getPseudoAway()
+ bool getPseudoAway() const
{ return mPseudoAwayMode; }
void setHalfAway(bool n)
{ mInactive = n; }
- bool getHalfAway()
+ bool getHalfAway() const
{ return mInactive; }
void afkRespond(ChatTab *tab, const std::string &nick);
@@ -369,7 +369,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void setRealPos(int x, int y);
- bool isServerBuggy()
+ bool isServerBuggy() const
{ return mIsServerBuggy; }
void fixPos(int maxDist = 1);
@@ -413,7 +413,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
void respawn();
- FloorItem *getPickUpTarget()
+ FloorItem *getPickUpTarget() const
{ return mPickUpTarget; }
void unSetPickUpTarget()
diff --git a/src/map.cpp b/src/map.cpp
index ccb56561c..488fb16e9 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -156,7 +156,7 @@ void MapLayer::optionChanged(const std::string &value)
void MapLayer::setTile(int x, int y, Image *img)
{
- setTile(x + y * mWidth, img);
+ mTiles[x + y * mWidth] = img;
}
void MapLayer::draw(Graphics *graphics, int startX, int startY,
diff --git a/src/map.h b/src/map.h
index f336a7a72..e157628cc 100644
--- a/src/map.h
+++ b/src/map.h
@@ -192,7 +192,7 @@ class MapLayer: public ConfigListener
const Actors *actors,
int mDebugFlags, int yFix) const;
- bool isFringeLayer()
+ bool isFringeLayer() const
{ return mIsFringeLayer; }
void setSpecialLayer(SpecialLayer *val)
@@ -201,10 +201,10 @@ class MapLayer: public ConfigListener
void setTempLayer(SpecialLayer *val)
{ mTempLayer = val; }
- int getWidth()
+ int getWidth() const
{ return mWidth; }
- int getHeight()
+ int getHeight() const
{ return mHeight; }
// void setTileInfo(int x, int y, int width, int cnt);
@@ -356,12 +356,14 @@ class Map : public Properties, public ConfigListener
/**
* Returns the width of this map in tiles.
*/
- int getWidth() const { return mWidth; }
+ int getWidth() const
+ { return mWidth; }
/**
* Returns the height of this map in tiles.
*/
- int getHeight() const { return mHeight; }
+ int getHeight() const
+ { return mHeight; }
/**
* Returns the tile width of this map.
@@ -376,6 +378,7 @@ class Map : public Properties, public ConfigListener
{ return mTileHeight; }
const std::string getMusicFile() const;
+
const std::string getName() const;
/**
@@ -435,16 +438,16 @@ class Map : public Properties, public ConfigListener
void saveExtraLayer();
- SpecialLayer *getTempLayer()
+ SpecialLayer *getTempLayer() const
{ return mTempLayer; }
- SpecialLayer *getSpecialLayer()
+ SpecialLayer *getSpecialLayer() const
{ return mSpecialLayer; }
void setHasWarps(bool n)
{ mHasWarps = n; }
- bool getHasWarps()
+ bool getHasWarps() const
{ return mHasWarps; }
std::string getUserMapDirectory() const;
@@ -477,7 +480,7 @@ class Map : public Properties, public ConfigListener
void setPvpMode(int mode);
- ObjectsLayer* getObjectsLayer()
+ ObjectsLayer* getObjectsLayer() const
{ return mObjects; }
std::string getObjectData(unsigned x, unsigned y, int type);
@@ -489,7 +492,7 @@ class Map : public Properties, public ConfigListener
void setActorsFix(int x, int y)
{ mActorFixX = x; mActorFixY = y; }
- int getVersion()
+ int getVersion() const
{ return mVersion; }
void setVersion(int n)
@@ -499,7 +502,7 @@ class Map : public Properties, public ConfigListener
void redrawMap();
- bool empty()
+ bool empty() const
{ return mLayers.empty(); }
protected:
diff --git a/src/net/manaserv/attributes.cpp b/src/net/manaserv/attributes.cpp
index 662032e29..c032b6bb8 100644
--- a/src/net/manaserv/attributes.cpp
+++ b/src/net/manaserv/attributes.cpp
@@ -73,16 +73,16 @@ namespace Attributes
static unsigned int attributeMinimum = 0;
static unsigned int attributeMaximum = 0;
- unsigned int getCreationPoints()
+ unsigned int getCreationPoints() const
{ return creationPoints; }
- unsigned int getAttributeMinimum()
+ unsigned int getAttributeMinimum() const
{ return attributeMinimum; }
- unsigned int getAttributeMaximum()
+ unsigned int getAttributeMaximum() const
{ return attributeMaximum; }
- std::vector<std::string>& getLabels()
+ std::vector<std::string>& getLabels() const
{ return attributeLabels; }
/**
diff --git a/src/net/manaserv/connection.h b/src/net/manaserv/connection.h
index 4263ae21f..1d3454c75 100644
--- a/src/net/manaserv/connection.h
+++ b/src/net/manaserv/connection.h
@@ -63,7 +63,7 @@ namespace ManaServ
*/
void disconnect();
- State getState()
+ State getState() const
{ return mState; }
/**
diff --git a/src/net/manaserv/gamehandler.h b/src/net/manaserv/gamehandler.h
index 443533bba..83e636e0e 100644
--- a/src/net/manaserv/gamehandler.h
+++ b/src/net/manaserv/gamehandler.h
@@ -52,14 +52,16 @@ class GameHandler : public MessageHandler, public Net::GameHandler
void ping(int tick);
- bool removeDeadBeings() const { return false; }
+ bool removeDeadBeings() const
+ { return false; }
void clear();
void gameLoading();
/** The ManaServ protocol doesn't use the MP status bar. */
- bool canUseMagicBar() const { return false; }
+ bool canUseMagicBar() const
+ { return false; }
void disconnect2();
};
diff --git a/src/net/manaserv/guildhandler.h b/src/net/manaserv/guildhandler.h
index 893a7157b..47d595bfa 100644
--- a/src/net/manaserv/guildhandler.h
+++ b/src/net/manaserv/guildhandler.h
@@ -35,7 +35,7 @@ class GuildHandler : public Net::GuildHandler, public MessageHandler
public:
GuildHandler();
- bool isSupported()
+ bool isSupported() const
{ return true; }
void handleMessage(Net::MessageIn &msg);
diff --git a/src/particle.h b/src/particle.h
index a79181498..7485b118f 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -219,7 +219,7 @@ class Particle : public Actor
/**
* Gets the flag if the particle is supposed to be moved by its parent
*/
- bool doesFollow()
+ bool doesFollow() const
{ return mFollow; }
/**
diff --git a/src/resources/action.h b/src/resources/action.h
index 1e3965363..3951cc02c 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -43,7 +43,7 @@ class Action
Animation *getAnimation(int direction) const;
- unsigned getNumber()
+ unsigned getNumber() const
{ return mNumber; }
void setNumber(unsigned n)
diff --git a/src/resources/image.h b/src/resources/image.h
index d22ed4be2..68ab09e58 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -103,7 +103,7 @@ class Image : public Resource
/**
* Tells is the image is loaded
*/
- bool isLoaded()
+ bool isLoaded() const
{ return mLoaded; }
/**
@@ -217,16 +217,16 @@ class Image : public Resource
static int mTextureType;
#endif
- bool isHasAlphaChannel()
+ bool isHasAlphaChannel() const
{ return mHasAlphaChannel; }
- bool isAlphaVisible()
+ bool isAlphaVisible() const
{ return mIsAlphaVisible; }
void setAlphaVisible(bool b)
{ mIsAlphaVisible = b; }
- bool isAlphaCalculated()
+ bool isAlphaCalculated() const
{ return mIsAlphaCalculated; }
void setAlphaCalculated(bool b)
diff --git a/src/resources/imageset.h b/src/resources/imageset.h
index 69ebebdc0..edfc4b123 100644
--- a/src/resources/imageset.h
+++ b/src/resources/imageset.h
@@ -63,13 +63,13 @@ class ImageSet : public Resource
size_type size() const
{ return mImages.size(); }
- int getOffsetX()
+ int getOffsetX() const
{ return mOffsetX; }
void setOffsetX(int n)
{ mOffsetX = n; }
- int getOffsetY()
+ int getOffsetY() const
{ return mOffsetY; }
void setOffsetY(int n)
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 8c5e2dd8f..5f789663f 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -148,7 +148,8 @@ class ItemInfo
void setEffect(const std::string &effect)
{ mEffect = effect; }
- const std::string &getEffect() const { return mEffect; }
+ const std::string &getEffect() const
+ { return mEffect; }
void setType(ItemType type)
{ mType = type; }
@@ -250,7 +251,7 @@ class ItemInfo
void setColorsList(std::string name);
- bool isHaveColors()
+ bool isHaveColors() const
{ return !mColorList.empty(); }
const std::string replaceColors(std::string str,
diff --git a/src/resources/resource.h b/src/resources/resource.h
index b8e06aaa7..c0ea7ca23 100644
--- a/src/resources/resource.h
+++ b/src/resources/resource.h
@@ -73,7 +73,7 @@ class Resource
{ return mRefCount; }
#ifdef DEBUG_DUMP_LEAKS
- bool getDumped()
+ bool getDumped() const
{ return mDumped; }
void setDumped(bool n)
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 7b61e2eaa..9df96d354 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -254,17 +254,17 @@ class ResourceManager
*/
static void deleteInstance();
- int size()
+ int size() const
{ return mResources.size(); }
typedef std::map<std::string, Resource*> Resources;
typedef Resources::iterator ResourceIterator;
#ifdef DEBUG_DUMP_LEAKS
- Resources* getResources()
+ Resources* getResources() const
{ return &mResources; }
- Resources* getOrphanedResources()
+ Resources* getOrphanedResources() const
{ return &mOrphanedResources; }
#endif
diff --git a/src/sound.h b/src/sound.h
index 869f136da..7f9fb64a4 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -115,7 +115,7 @@ class Sound : public ConfigListener
void volumeRestore();
- std::string getCurrentMusicFile()
+ std::string getCurrentMusicFile() const
{ return mCurrentMusicFile; }
/**
diff --git a/src/textcommand.h b/src/textcommand.h
index b1af7667d..27b44cc7a 100644
--- a/src/textcommand.h
+++ b/src/textcommand.h
@@ -155,7 +155,7 @@ class TextCommand
bool isEmpty() const
{ return mCommand == "" && mSymbol == "" ; }
- Image *getImage()
+ Image *getImage() const
{ return mImage; }
private: