mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Correctly retrieve the game rack
This commit is contained in:
parent
4077a25fa0
commit
22fd6484f3
4 changed files with 6 additions and 6 deletions
|
@ -33,6 +33,7 @@ using std::vector;
|
|||
class Move;
|
||||
class Turn;
|
||||
class PlayedRack;
|
||||
class Rack;
|
||||
|
||||
/**
|
||||
* History stores all the turns that have been played
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<Tile> 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())
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue