Age | Commit message (Collapse) | Author |
|
|
|
* Remove all uses of `using namespace std` from header files (although a
few specific cases of things like `using std::vector` remain)
* Move all existing uses of `using namespace std` in cpp files to after the
header includes
* Make coordinating changes so it builds again.
Qt6 builds on Windows were breaking because of namespace collision between
std::byte and some version of `byte` in one of Qt's namespaces. That breakage
is now fixed.
It would be good to systematically clean up all `using` declarations in header
files to ensure nothing is leaking out, but that's for another time.
|
|
* Replace std::random_shuffle() with std::shuffle().
* Populate switch statements which were checking the
Move enums, but not Move::PlaceError.
* endl -> Qt::endl for QTextStream usage.
* QString::SkipEmptyParts -> Qt::SkipEmptyParts
* QLabel::pixmap() now takes Qt::ReturnByValue
* Use QElapsedTimer where appropriate.
|
|
|
|
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.
|
|
The tile counting code wasn't properly tracking challenged phonies.
Also, it could get off right at the beginning. I think I didn't see this
before because I was testing with an unusual game that started
off with a pass and a bingo.
|
|
My end-game management was working fine for the case
I had been trying most...unknown racks and blind exchanges.
But I forgot to prevent regular exchanges from depleting the
overall tile counts. And I didn't realize that this code might
be called with a clipped history, due to the way that the
computer players can clone game boards for simulations.
I think this fixes all of the problems I introduced, while keeping
the endgame tile counts correct in the unknown racks case.
|
|
|
|
If you're entering games with unknown racks, Quackle can
get confused about which player has how many tiles in the
end game. This is because the racks may have been set to
have less than 7 tiles, and some of the tiles "in the bag" may
actually belong on another player's rack. Fixed this by...
* Adding a mechanism which tracks the actual count of
tiles in the bag and on the rack in GamePosition. This
count is independent of what's actually on the rack.
* If the game is about to end because the bag and rack
are empty, check to see if the rack *should* have been
empty. If not, pull tiles from another player's rack.
This code might fail for games of more than two players.
* If the game should be ending because the bag and
rack are empty, but the rack isn't actually empty, then
dump the files to another player's rack. Once again,
this code doesn't take into account >2 players.
|
|
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.
|
|
|
|
|