diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-08 23:24:37 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-09 22:48:21 +0200 |
commit | 69d8407badcb703709534f5097b9b5697ac3404c (patch) | |
tree | 7a7e126b0ce0181f22397d62ca3d4e553482b439 /src/gui | |
parent | 1158bce840bbd76a297c4f5eefd19444584f6fcd (diff) | |
download | mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.gz mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.bz2 mana-69d8407badcb703709534f5097b9b5697ac3404c.tar.xz mana-69d8407badcb703709534f5097b9b5697ac3404c.zip |
Made BeingManager methods const where appropriate
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 6 | ||||
-rw-r--r-- | src/gui/minimap.cpp | 4 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/chattab.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/chattab.h | 1 |
5 files changed, 8 insertions, 13 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index b7a57da5..ab98b594 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -287,11 +287,11 @@ void ChatWindow::chatInput(std::string &msg) void ChatWindow::doPresent() { - Beings & beings = beingManager->getAll(); + const Beings &beings = beingManager->getAll(); std::string response = ""; - for (BeingIterator bi = beings.begin(), be = beings.end(); - bi != be; ++bi) + for (Beings::const_iterator bi = beings.begin(), be = beings.end(); + bi != be; ++bi) { if ((*bi)->getType() == Being::PLAYER) { diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index bfd34390..061a2ace 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -136,9 +136,9 @@ void Minimap::draw(gcn::Graphics *graphics) } const Beings &beings = beingManager->getAll(); - Beings::const_iterator bi; - for (bi = beings.begin(); bi != beings.end(); bi++) + for (Beings::const_iterator bi = beings.begin(), bi_end = beings.end(); + bi != bi_end; ++bi) { const Being *being = (*bi); int dotSize = 2; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 6dd1cb92..3fc5f2d4 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -214,8 +214,9 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) } // Draw player names, speech, and emotion sprite as needed - Beings &beings = beingManager->getAll(); - for (BeingIterator i = beings.begin(); i != beings.end(); i++) + const Beings &beings = beingManager->getAll(); + for (Beings::const_iterator i = beings.begin(), i_end = beings.end(); + i != i_end; ++i) { (*i)->drawSpeech((int) mPixelViewX, (int) mPixelViewY); (*i)->drawEmotion(graphics, (int) mPixelViewX, (int) mPixelViewY); diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 0dcb2fdf..f3258f04 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -68,11 +68,6 @@ ChatTab::~ChatTab() delete mScrollArea; } -void ChatTab::chatLog(const char* line, int own, bool ignoreRecord) -{ - chatLog(std::string(line), own, ignoreRecord); -} - void ChatTab::chatLog(std::string line, int own, bool ignoreRecord) { // Trim whitespace diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index ad7c90bb..3d92e57f 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -69,7 +69,6 @@ class ChatTab : public Tab * @param ignoreRecord should this not be recorded? */ void chatLog(std::string line, int own = BY_SERVER, bool ignoreRecord = false); - void chatLog(const char* line, int own = BY_SERVER, bool ignoreRecord = false); /** * Adds the text to the message list |