mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-16 07:47:39 +01:00
New Round::countJokersFromRack() utility method
This commit is contained in:
parent
22fd6484f3
commit
d5c53b92d0
2 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -73,6 +73,8 @@ public:
|
|||
bool getBonus() const { return m_bonus; }
|
||||
const vector<Tile> &getTiles() const { return m_word; }
|
||||
|
||||
unsigned countJokersFromRack() const;
|
||||
|
||||
/*************************
|
||||
* Coordinates
|
||||
*************************/
|
||||
|
|
Loading…
Reference in a new issue