From dbcb13d3c87133117bc54023c162ad0a202efa1d Mon Sep 17 00:00:00 2001 From: John Fultz Date: Tue, 2 Aug 2016 04:08:43 -0500 Subject: Fixes to allow bad endgames to be loaded from GCGs. Not perfect, but it now does a decent job of not corrupting GCGs when it loads one where players have messed up tile counts/drawing in the end-game. It also tries to annotate these for the player and in any GCG file that's round-tripped. Also, a lot of C++11-izing of ranged iterators. --- quackleio/util.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'quackleio/util.cpp') diff --git a/quackleio/util.cpp b/quackleio/util.cpp index 901c65e..774dcad 100644 --- a/quackleio/util.cpp +++ b/quackleio/util.cpp @@ -59,8 +59,11 @@ QString Util::moveToDetailedString(const Quackle::Move &move) ret = QObject::tr("Exch. %1").arg(move.tiles().length()); break; + case Quackle::Move::UnusedTilesBonusError: case Quackle::Move::UnusedTilesBonus: ret = QObject::tr("2*(%1)").arg(letterStringToQString(Util::alphagram(move.usedTiles()))); + if (move.action == Quackle::Move::UnusedTilesBonusError) + ret += " [Endgame Error]"; break; case Quackle::Move::TimePenalty: @@ -72,6 +75,7 @@ QString Util::moveToDetailedString(const Quackle::Move &move) break; case Quackle::Move::Place: + case Quackle::Move::PlaceError: ret = uvStringToQString(move.positionString()) + " "; ret += prettyTiles; @@ -81,6 +85,9 @@ QString Util::moveToDetailedString(const Quackle::Move &move) if (move.isChallengedPhoney()) ret = QObject::tr("%1 [Challenged Off]").arg(ret); + if (move.action == Quackle::Move::PlaceError) + ret += " [Endgame Misdraw]"; + break; } -- cgit v1.2.3