diff --git a/game/history.h b/game/history.h index 49a15f2..cde51df 100644 --- a/game/history.h +++ b/game/history.h @@ -33,6 +33,7 @@ using std::vector; class Move; class Turn; class PlayedRack; +class Rack; /** * History stores all the turns that have been played diff --git a/qt/bag_widget2.cpp b/qt/bag_widget2.cpp index 7749fbb..a008878 100644 --- a/qt/bag_widget2.cpp +++ b/qt/bag_widget2.cpp @@ -117,8 +117,7 @@ void BagWidget2::refresh() m_tilesVect.push_back(tileWidget); } - // XXX: ugly (and wrong) way to get the rack - const Rack &rack = m_game->getCurrentPlayer().getCurrentRack().getRack(); + const Rack &rack = m_game->getHistory().getCurrentRack().getRack(); TileWidget::State previewState = m_showTilesInRack ? TileWidget::PREVIEW : TileWidget::NORMAL; diff --git a/qt/rack_widget.cpp b/qt/rack_widget.cpp index a30c466..92b804c 100644 --- a/qt/rack_widget.cpp +++ b/qt/rack_widget.cpp @@ -26,7 +26,7 @@ #include "qtcommon.h" #include "public_game.h" -#include "player.h" +#include "history.h" #include "pldrack.h" #include "debug.h" @@ -65,9 +65,9 @@ void RackWidget::refresh() if (m_game == NULL) return; - // XXX: ugly (and wrong) way to get the rack + // Get the rack vector tiles; - m_game->getCurrentPlayer().getCurrentRack().getAllTiles(tiles); + m_game->getHistory().getCurrentRack().getAllTiles(tiles); // Make sure we have as many widgets as there are letters in the rack while (m_tilesVect.size() > tiles.size()) diff --git a/utils/game_io.cpp b/utils/game_io.cpp index 19a1896..c03545c 100644 --- a/utils/game_io.cpp +++ b/utils/game_io.cpp @@ -215,7 +215,7 @@ void GameIO::printNonPlayed(ostream &out, const PublicGame &iGame) void GameIO::printPlayedRack(ostream &out, const PublicGame &iGame, int __UNUSED__ n) { - out << lfw(iGame.getCurrentPlayer().getCurrentRack().toString(PlayedRack::RACK_SIMPLE)) << endl; + out << lfw(iGame.getHistory().getCurrentRack().toString(PlayedRack::RACK_SIMPLE)) << endl; }