mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Improve the detection of finished games for duplicate and arbitration modes
This commit is contained in:
parent
f1123e1229
commit
bcc2aedbff
6 changed files with 8 additions and 11 deletions
|
@ -160,7 +160,7 @@ void Duplicate::start()
|
|||
|
||||
bool Duplicate::isFinished() const
|
||||
{
|
||||
return m_finished;
|
||||
return !canDrawRack(m_players[0]->getHistory().getCurrentRack(), true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,7 +351,6 @@ void Duplicate::endGame()
|
|||
LOG_INFO("End of the game");
|
||||
// No more master move
|
||||
setMasterMove(Move());
|
||||
m_finished = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ INIT_LOGGER(game, FreeGame);
|
|||
|
||||
|
||||
FreeGame::FreeGame(const GameParams &iParams)
|
||||
: Game(iParams)
|
||||
: Game(iParams), m_finished(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -150,6 +150,7 @@ void FreeGame::start()
|
|||
|
||||
bool FreeGame::isFinished() const
|
||||
{
|
||||
// FIXME: the flag is never reset to false!
|
||||
return m_finished;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,10 @@ public:
|
|||
int pass(const wstring &iToChange);
|
||||
|
||||
private:
|
||||
// Private constructor to force using the GameFactory class
|
||||
/// True if the game is finished, false otherwise
|
||||
bool m_finished;
|
||||
|
||||
/// Private constructor to force using the GameFactory class
|
||||
FreeGame(const GameParams &iParams);
|
||||
|
||||
/// Make the AI player whose ID is p play its turn
|
||||
|
|
|
@ -54,7 +54,6 @@ Game::Game(const GameParams &iParams):
|
|||
{
|
||||
m_points = 0;
|
||||
m_currPlayer = 0;
|
||||
m_finished = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -230,8 +230,6 @@ protected:
|
|||
/// Bag
|
||||
Bag m_bag;
|
||||
|
||||
bool m_finished;
|
||||
|
||||
/*********************************************************
|
||||
* Helper functions
|
||||
*********************************************************/
|
||||
|
|
|
@ -141,10 +141,7 @@ void ArbitAssignments::refresh()
|
|||
labelMasterMove->setText(label);
|
||||
}
|
||||
|
||||
if (m_game->isFinished())
|
||||
{
|
||||
setEnabled(false);
|
||||
}
|
||||
setEnabled(!m_game->isFinished());
|
||||
|
||||
enableAssignmentButtons();
|
||||
buttonSelectMaster->setEnabled(isAssignMasterAllowed());
|
||||
|
|
Loading…
Reference in a new issue