mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-30 20:34:27 +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 Move;
|
||||||
class Turn;
|
class Turn;
|
||||||
class PlayedRack;
|
class PlayedRack;
|
||||||
|
class Rack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* History stores all the turns that have been played
|
* History stores all the turns that have been played
|
||||||
|
|
|
@ -117,8 +117,7 @@ void BagWidget2::refresh()
|
||||||
m_tilesVect.push_back(tileWidget);
|
m_tilesVect.push_back(tileWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: ugly (and wrong) way to get the rack
|
const Rack &rack = m_game->getHistory().getCurrentRack().getRack();
|
||||||
const Rack &rack = m_game->getCurrentPlayer().getCurrentRack().getRack();
|
|
||||||
TileWidget::State previewState =
|
TileWidget::State previewState =
|
||||||
m_showTilesInRack ? TileWidget::PREVIEW : TileWidget::NORMAL;
|
m_showTilesInRack ? TileWidget::PREVIEW : TileWidget::NORMAL;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "qtcommon.h"
|
#include "qtcommon.h"
|
||||||
|
|
||||||
#include "public_game.h"
|
#include "public_game.h"
|
||||||
#include "player.h"
|
#include "history.h"
|
||||||
#include "pldrack.h"
|
#include "pldrack.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ void RackWidget::refresh()
|
||||||
if (m_game == NULL)
|
if (m_game == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// XXX: ugly (and wrong) way to get the rack
|
// Get the rack
|
||||||
vector<Tile> tiles;
|
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
|
// Make sure we have as many widgets as there are letters in the rack
|
||||||
while (m_tilesVect.size() > tiles.size())
|
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)
|
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…
Add table
Reference in a new issue