From 6dc05081b0b7ef3cde5bc2d016381623839c6dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Thu, 17 Jan 2013 17:19:10 +0100 Subject: [PATCH] Bag: rename a member variable --- game/bag.cpp | 12 ++++++------ game/bag.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/game/bag.cpp b/game/bag.cpp index 7a31094..bfb6127 100644 --- a/game/bag.cpp +++ b/game/bag.cpp @@ -35,12 +35,12 @@ INIT_LOGGER(game, Bag); Bag::Bag(const Dictionary &iDic) - : m_dic(iDic), m_ntiles(0) + : m_dic(iDic), m_nbTiles(0) { BOOST_FOREACH(const Tile &tile, m_dic.getAllTiles()) { m_tilesMap[tile] = tile.maxNumber(); - m_ntiles += tile.maxNumber(); + m_nbTiles += tile.maxNumber(); } } @@ -88,7 +88,7 @@ void Bag::takeTile(const Tile &iTile) "The bag does not contain the letter " + lfw(iTile.getDisplayStr())); m_tilesMap[iTile]--; - m_ntiles--; + m_nbTiles--; } @@ -98,13 +98,13 @@ void Bag::replaceTile(const Tile &iTile) "Cannot replace tile: " + lfw(iTile.getDisplayStr())); m_tilesMap[iTile]++; - m_ntiles++; + m_nbTiles++; } Tile Bag::selectRandom() const { - return selectRandomTile(m_ntiles, false, false); + return selectRandomTile(m_nbTiles, false, false); } @@ -145,7 +145,7 @@ Tile Bag::selectRandomTile(unsigned int total, Bag & Bag::operator=(const Bag &iOther) { m_tilesMap = iOther.m_tilesMap; - m_ntiles = iOther.m_ntiles; + m_nbTiles = iOther.m_nbTiles; return *this; } diff --git a/game/bag.h b/game/bag.h index 9864db4..b6ad47f 100644 --- a/game/bag.h +++ b/game/bag.h @@ -53,7 +53,7 @@ public: * Warning: b.getNbVowels() + b.getNbConsonants() != b.getNbTiles(), * because of the jokers and the 'Y'. */ - unsigned int getNbTiles() const { return m_ntiles; } + unsigned int getNbTiles() const { return m_nbTiles; } unsigned int getNbVowels() const; unsigned int getNbConsonants() const; @@ -91,7 +91,7 @@ private: map m_tilesMap; /// Total number of tiles in the bag - int m_ntiles; + int m_nbTiles; /// Helper method, used by the various selectRandom*() methods Tile selectRandomTile(unsigned int total,