Fixed a comment and made PlayedRack::toString() a const method

This commit is contained in:
Olivier Teulière 2005-04-02 18:05:21 +00:00
parent 383548a799
commit ce71e10aef
2 changed files with 15 additions and 15 deletions

View file

@ -3,7 +3,7 @@
* Authors: Antoine Fraboulet <antoine.fraboulet@free.fr>
* Olivier Teuliere <ipkiss@via.ecp.fr>
*
* $Id: pldrack.cpp,v 1.2 2005/03/29 06:54:08 afrab Exp $
* $Id: pldrack.cpp,v 1.3 2005/04/02 18:05:21 ipkiss Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -170,22 +170,22 @@ void PlayedRack::operator=(const PlayedRack &iOther)
}
void PlayedRack::toString(string& s)
void PlayedRack::toString(string& s) const
{
vector<Tile>::const_iterator it;
s = "";
if (nOld() > 0)
vector<Tile>::const_iterator it;
s = "";
if (nOld() > 0)
{
for (it = m_oldTiles.begin(); it != m_oldTiles.end(); it++)
s += it->toChar();
for (it = m_oldTiles.begin(); it != m_oldTiles.end(); it++)
s += it->toChar();
}
if (nOld() > 0 && nNew() > 0)
if (nOld() > 0 && nNew() > 0)
{
s += "+";
s += "+";
}
if (nNew() > 0)
if (nNew() > 0)
{
for (it = m_newTiles.begin(); it != m_newTiles.end(); it++)
s += it->toChar();
for (it = m_newTiles.begin(); it != m_newTiles.end(); it++)
s += it->toChar();
}
}

View file

@ -3,7 +3,7 @@
* Authors: Antoine Fraboulet <antoine.fraboulet@free.fr>
* Olivier Teuliere <ipkiss@via.ecp.fr>
*
* $Id: pldrack.h,v 1.5 2005/03/29 06:54:08 afrab Exp $
* $Id: pldrack.h,v 1.6 2005/04/02 18:05:21 ipkiss Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -35,7 +35,7 @@ using namespace std;
* A Playedrack is an "improved" rack, allowing to differentiate new letters
* from letters that are left from the previous rack.
* This is useful, to be able to write a rack on the form ABC+DEFG, where
* A, B, C are the "old" letters and E, F, G, H are the "new" ones.
* A, B, C are the "old" letters and D, E, F, G are the "new" ones.
*/
class PlayedRack
{
@ -66,7 +66,7 @@ public:
bool checkRack(int iMin);
void operator=(const PlayedRack &iOther);
void toString(string&);
void toString(string&) const;
private:
vector<Tile> m_oldTiles;