diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-04 19:11:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-04 19:11:53 +0300 |
commit | 3a407bb6b73a186eafd99bcec570f88097c4b2e1 (patch) | |
tree | ea57a752c348ba0a883294855ad3c62c16e9749d /src/text.h | |
parent | 872fc368f7b253f26714fc47323064f270b62b40 (diff) | |
download | manaplus-3a407bb6b73a186eafd99bcec570f88097c4b2e1.tar.gz manaplus-3a407bb6b73a186eafd99bcec570f88097c4b2e1.tar.bz2 manaplus-3a407bb6b73a186eafd99bcec570f88097c4b2e1.tar.xz manaplus-3a407bb6b73a186eafd99bcec570f88097c4b2e1.zip |
Add const to more classes.
Diffstat (limited to 'src/text.h')
-rw-r--r-- | src/text.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/text.h b/src/text.h index f585cca36..e4ad4ab06 100644 --- a/src/text.h +++ b/src/text.h @@ -39,17 +39,17 @@ class Text /** * Constructor creates a text object to display on the screen. */ - Text(const std::string &text, int x, int y, - gcn::Graphics::Alignment alignment, - const gcn::Color *color, bool isSpeech = false, - gcn::Font *font = nullptr); + Text(const std::string &text, const int x, const int y, + const gcn::Graphics::Alignment alignment, + const gcn::Color *const color, const bool isSpeech = false, + gcn::Font *const font = nullptr); /** * Destructor. The text is removed from the screen. */ virtual ~Text(); - void setColor(const gcn::Color *color); + void setColor(const gcn::Color *const color); int getWidth() const { return mWidth; } @@ -60,12 +60,13 @@ class Text /** * Allows the originator of the text to specify the ideal coordinates. */ - void adviseXY(int x, int y); + void adviseXY(const int x, const int y); /** * Draws the text. */ - virtual void draw(gcn::Graphics *graphics, int xOff, int yOff); + virtual void draw(gcn::Graphics *const graphics, + const int xOff, const int yOff); private: int mX; /**< Actual x-value of left of text written. */ @@ -86,10 +87,10 @@ class Text class FlashText : public Text { public: - FlashText(const std::string &text, int x, int y, - gcn::Graphics::Alignment alignment, - const gcn::Color* color, - gcn::Font *font = nullptr); + FlashText(const std::string &text, const int x, const int y, + const gcn::Graphics::Alignment alignment, + const gcn::Color *const color, + gcn::Font *const font = nullptr); /** * Remove the text from the screen @@ -100,13 +101,14 @@ class FlashText : public Text /** * Flash the text for so many refreshes. */ - void flash(int time) + void flash(const int time) { mTime = time; } /** * Draws the text. */ - virtual void draw(gcn::Graphics *graphics, int xOff, int yOff); + virtual void draw(gcn::Graphics *const graphics, + const int xOff, const int yOff); private: int mTime; /**< Time left for flashing */ |