New Round::countJokersFromRack() utility method

This commit is contained in:
Olivier Teulière 2012-03-04 22:58:53 +01:00
parent 22fd6484f3
commit d5c53b92d0
2 changed files with 14 additions and 0 deletions

View file

@ -131,6 +131,18 @@ wstring Round::getWord() const
}
unsigned Round::countJokersFromRack() const
{
unsigned count = 0;
for (unsigned int i = 0; i < getWordLen(); i++)
{
if (isJoker(i) && isPlayedFromRack(i))
++count;
}
return count;
}
wstring Round::toString() const
{
wostringstream oss;

View file

@ -73,6 +73,8 @@ public:
bool getBonus() const { return m_bonus; }
const vector<Tile> &getTiles() const { return m_word; }
unsigned countJokersFromRack() const;
/*************************
* Coordinates
*************************/