diff options
author | John Fultz <jfultz@wolfram.com> | 2016-07-03 02:54:38 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2016-07-03 02:54:38 -0500 |
commit | da2f20720facda706be06b5813ab20057d5b4de9 (patch) | |
tree | e2d266054b384d7d5a5fd38c19bf18d1f952ed61 /quacker | |
parent | 0cda99549250c87ab9c9b20044767a7615e279c6 (diff) |
Fix problems with "ex n" where n is a number.
Found a crash where you enter "ex 4" twice,
and it would crash. This led me to look up
how this was implemented, and it wasn't
very robust. It also didn't save properly in
the GCG. So I created a new move type
which I called a BlindExchange and implemented
it throughout the system.
Diffstat (limited to 'quacker')
-rw-r--r-- | quacker/boarddisplay.cpp | 2 | ||||
-rw-r--r-- | quacker/graphicalreporter.cpp | 1 | ||||
-rw-r--r-- | quacker/quacker.cpp | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/quacker/boarddisplay.cpp b/quacker/boarddisplay.cpp index 2f570c6..85b551b 100644 --- a/quacker/boarddisplay.cpp +++ b/quacker/boarddisplay.cpp @@ -178,7 +178,7 @@ void BoardWithQuickEntry::processCommand(const QString &command) if (isPass) move = Quackle::Move::createPassMove(); else - move = Quackle::Move::createExchangeMove(encodedLetters); + move = Quackle::Move::createExchangeMove(encodedLetters, isIntConvertable); } else { diff --git a/quacker/graphicalreporter.cpp b/quacker/graphicalreporter.cpp index 2fb0842..a7ca9f5 100644 --- a/quacker/graphicalreporter.cpp +++ b/quacker/graphicalreporter.cpp @@ -192,6 +192,7 @@ void GraphicalReporter::reportPosition(const Quackle::GamePosition &position, Qu } case Quackle::Move::Exchange: + case Quackle::Move::BlindExchange: default: item = QuackleIO::Util::moveToDetailedString(*it); break; diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index be70c14..ffe6531 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -396,7 +396,9 @@ void TopLevel::setCandidateMove(const Quackle::Move &move) ensureUpToDateSimulatorMoveList(); } - if (!m_game->currentPosition().currentPlayer().racksAreKnown() && !m_game->currentPosition().currentPlayer().rack().contains(prettiedMove.usedTiles())) + if (!m_game->currentPosition().currentPlayer().racksAreKnown() && + !m_game->currentPosition().currentPlayer().rack().contains(prettiedMove.usedTiles()) && + prettiedMove.action != Quackle::Move::BlindExchange) { m_game->currentPosition().setCurrentPlayerRack(Quackle::Rack(prettiedMove.usedTiles())); } |