date | project | content | link |
|---|
| 03:55 on May 01 | KDE | Commit by coates :: r 1229904 kpat/trunk/KDE/kdegames/kpat/libkcardgame/kcardscene.cpp: ( link) Minor cleanup of KCardScenePrivate::sendCardsToPile().
* Renamed some variables.
* Got rid of an unused QList.
* Added some comments.
* Shuffled some code around. | # |
| 03:55 on May 01 | KDE | Commit by coates :: r 1229903 kpat/trunk/KDE/kdegames/kpat/libkcardgame/kcardscene.cpp: ( link) Correct card ordering in KCardScene::flipCardsToPile().
When flipping multiple cards from one pile to another, we have to reverse the stacking order of the cards. The topmost card on the source pile becomes the bottommost card on the destination pile. This fixes the waste to stock recycling in both Klondike and Forty & Eight.
The previous behaviour wasn't necessarily wrong, but it did represent a maneuver that can't really be done with real cards in a single move, hence it wasn't the correct behaviour for the games in question. | # |
| 03:06 on Apr 16 | KDE | Commit by coates :: r 1228141 kpat/branches/KDE/4.6/kdegames/kpat/patsolve/spidersolver.cpp: ( link) Backport of commit 1228140.
Make the Spider solver check all cards are face up before moving runs.
This was simply a missing check.
CCBUG:265857 FIXED-IN:SC4.6.3 | # |
| 02:54 on Apr 16 | KDE | Commit by coates :: r 1228140 kpat/trunk/KDE/kdegames/kpat/patsolve/spidersolver.cpp: ( link) Make the Spider solver check all cards are face up before moving runs.
This was simply a missing check.
BUG:265857 | # |
| 17:16 on Mar 24 | KDE | Commit by coates :: r 1225910 kpat/trunk/KDE/kdegames/kpat/dealer.cpp: ( link) Remove assert from Dealer destructor to fix the last commit.
I didn't mean to commit the change to dealer.cpp in the last commit. That change was a bad idea and will cause asserts when changing games or shutting down. | # |
| 17:14 on Mar 24 | KDE | Commit by coates :: r 1225909 kpat/trunk/KDE/kdegames/kpat/ (dealer.cpp libkcardgame/kcardscene.cpp): ( link) Remove an overly strict assert from KCardScene.
Checking that the scene is empty before destroying itself was a good idea to ensure proper cleanup in KPat, but it's way to strict a requirement to enforce on all users of LibKCardGame. | # |
| 21:01 on Feb 15 | KDE | Commit by coates :: r 1220957 kpat/trunk/KDE/kdegames/kpat/dealer.cpp: ( link) Free up the source pile for the second half of a multiStepMove. | # |
| 21:01 on Feb 15 | KDE | Commit by coates :: r 1220956 kpat/trunk/KDE/kdegames/kpat/dealer.cpp: ( link) The multiStepMove algorithm doesn't actually require any free cells.
We can now get by just fine without any free cells without using any extra moves. | # |
| 21:01 on Feb 15 | KDE | Commit by coates :: r 1220955 kpat/trunk/KDE/kdegames/kpat/dealer.cpp: ( link) Improve multiStepMove algorithm to make better use of available piles.
The previous implementation was explicitly optimised to use the minimum number of piles possible. This made it usable in every situation, but also meant that many moves were taking more steps than was actually necessary. This was most noticeable when a lot of time was spent unstacking and restacking cards on a couple of piles while there were other piles going completely unused.
After some experimentation, the new algorithm uses up to 40% fewer moves than the previous one. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220954 kpat/trunk/KDE/kdegames/kpat/libkcardgame/ (kcardscene.cpp kcardscene.h): ( link) Make KCardScene::setItemHighlight() a private helper function.
I'm not sure why this method ever made it in to the public API, let alone why it was made virtual. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220953 kpat/trunk/KDE/kdegames/kpat/libkcardgame/kcardscene.cpp: ( link) Remove an unused geometry helper function. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220952 kpat/trunk/KDE/kdegames/kpat/libkcardgame/ (kcardscene.cpp kcardscene.h): ( link) Make KCardScene::targetPile() private and non-virtual.
I can't currently see any reason why a subclass would want to reimplement this functionality and it's always easier to make private stuff public later than vice versa.
Also gave the method a ridiculously explicit new name. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220949 kpat/trunk/KDE/kdegames/kpat/ (3 files in 2 dirs): ( link) Add KCardPile::topCards(int) to return the top n cards of a pile. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220951 kpat/trunk/KDE/kdegames/kpat/ (spider.cpp spider.h): ( link) Simplify the Spider run moving code.
Made use of some of the newer facilities available since this code was originally written, which hopefully means less code that's easier to understand. Also commented a couple of the more confusing parts with respect to demo mode being handled differently. | # |
| 20:58 on Feb 15 | KDE | Commit by coates :: r 1220948 kpat/trunk/KDE/kdegames/kpat/ (3 files in 2 dirs): ( link) Remove KCardPile::setGraphicVisible() and isGraphicVisible().
Now that subclasses can redefine their painting, there isn't really much purpose in keeping API to control the visibility of the pile graphic. This was only being used in Spider anyway, which now just uses a private InvisiblePile class. | # |
| 20:57 on Feb 15 | KDE | Commit by coates :: r 1220947 kpat/trunk/KDE/kdegames/kpat/ (17 files): ( link) Clean up (set|get)Game(State|Options) functions. | # |
| 20:57 on Feb 15 | KDE | Commit by coates :: r 1220946 kpat/trunk/KDE/kdegames/kpat/libkcardgame/ (kcardscene.cpp kcardscene.h): ( link) Add KCardScenePrivate::sendCardsToPile() to handle all card movements.
By using a single method for all card movement operations and pile relayout animations removes a lot of hacks, like saving card positions, doing an instant relayout, saving the new positions, returning the cards to their original positions and then animating to the new positions. | # |
| 20:57 on Feb 15 | KDE | Commit by coates :: r 1220945 kpat/trunk/KDE/kdegames/kpat/ (10 files in 2 dirs): ( link) Add KCardScene::cardsMoved() protected virtual hook.
Making moveCardsToPile() virtual and a single hook point for all card movements seemed like a good idea at the time, but it's proved non-ideal in a few areas. So now moveCardsToPile() is no longer virtual and that role has been replaced with a new cardMoved() virtual hook that is called immediately after any cards have been moved. | # |
| 20:57 on Feb 15 | KDE | Commit by coates :: r 1220944 kpat/trunk/KDE/kdegames/kpat/ (6 files in 2 dirs): ( link) Add a new KCardScene::cardsDroppedOnPile() virtual hook.
cardDroppedOnPile() is called every time the user moves cards to a pile (via keyboard or mouse). The default implementation just calls moveCardsToPile() like before, but Freecell and Forty & Eight reimplement it to call multiStepMove() instead.
I'm still not sure if I'm happy with having this in KCardScene's public API. | # |
| 20:57 on Feb 15 | KDE | Commit by coates :: r 1220943 kpat/trunk/KDE/kdegames/kpat/ (3 files in 2 dirs): ( link) Replace KCardScene::relayoutPiles() with recalculatePileLayouts().
It's sometimes desirable to recalculate the space allocated to each pile without actually initiating the pile relayout animations. The only really use case thus far is Spider, but it certainly helps there. I think this area of the API could still use more work, though. | # |