mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Arbitration: when loading a saved game, make PlayerMoveCmd auto-executable.
This is not very clean, but without this the played moves of past turns are not visible. This commit also fixes a test with was incorrect.
This commit is contained in:
parent
34ed25e9e9
commit
08c3f2ccb2
3 changed files with 9 additions and 6 deletions
|
@ -429,7 +429,7 @@ void Duplicate::setGameAndPlayersRack(const PlayedRack &iRack)
|
|||
// and solos should be assigned.
|
||||
BOOST_FOREACH(Player *player, m_players)
|
||||
{
|
||||
Command *pCmd = new PlayerMoveCmd(*player, Move(), true);
|
||||
Command *pCmd = new PlayerMoveCmd(*player, Move());
|
||||
accessNavigation().addAndExecute(pCmd);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,9 +398,12 @@ void XmlReader::endElement(const string& namespaceURI,
|
|||
|
||||
else if (tag == "PlayerMove")
|
||||
{
|
||||
// FIXME: this is game-related logic. It should not be done here.
|
||||
bool isArbitrationGame = m_game->getParams().getMode() == GameParams::kARBITRATION;
|
||||
|
||||
const Move &move = buildMove(*m_game, m_attributes, /*XXX:true*/false);
|
||||
Player &p = getPlayer(m_players, m_attributes["playerId"], tag);
|
||||
PlayerMoveCmd *cmd = new PlayerMoveCmd(p, move);
|
||||
PlayerMoveCmd *cmd = new PlayerMoveCmd(p, move, isArbitrationGame);
|
||||
m_game->accessNavigation().addAndExecute(cmd);
|
||||
}
|
||||
|
||||
|
|
|
@ -169,10 +169,10 @@ Game: history:
|
|||
1 | 0 | CHARITO | CHARIOT | H3 | 82 | *
|
||||
|
||||
|
||||
Rack 0: LAERSIU
|
||||
Rack 1: LAERSIU
|
||||
Score 0: 80
|
||||
Score 1: 82
|
||||
Rack 0:
|
||||
Rack 1:
|
||||
Score 0: 154
|
||||
Score 1: 156
|
||||
commande> h n
|
||||
commande> t TEEEPMO
|
||||
commande> m ESTOMPEE O3
|
||||
|
|
Loading…
Reference in a new issue