gnome-games r8879 - trunk/aisleriot/rules



Author: vpovirk
Date: Mon Mar 23 02:53:19 2009
New Revision: 8879
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8879&view=rev

Log:
aisleriot: implement dealable feature in Forty Thieves

patch from Ed Sirett

fixes bug 573548


Modified:
   trunk/aisleriot/rules/forty_thieves.scm

Modified: trunk/aisleriot/rules/forty_thieves.scm
==============================================================================
--- trunk/aisleriot/rules/forty_thieves.scm	(original)
+++ trunk/aisleriot/rules/forty_thieves.scm	Mon Mar 23 02:53:19 2009
@@ -278,16 +278,21 @@
 
 
 
+(define (dealable?)
+   (not (empty-slot? stock-pile)))
 
 ;deals cards from deck to waste
 (define (button-clicked slot-id)
   (and (= slot-id stock-pile)
-       (not (empty-slot? slot-id))
+       (dealable?)
        (deal-cards-face-up stock-pile (list waste-pile))
        (recalculate-score)
   )
 )
 
+(define (do-deal-next-cards)
+  (button-clicked stock-pile))
+
 ; if we can find a move to the foundations do it and return #t or #f.
 (define (move-to-foundation) 
        (let ((move (find-any-move-to-foundation waste-pile))) 
@@ -438,8 +443,8 @@
 (define (timeout) 
   #f)
 
-(set-features droppable-feature)
+(set-features droppable-feature dealable-feature)
 
 (set-lambda new-game button-pressed button-released button-clicked
 button-double-clicked game-continuable game-won get-hint get-options
-apply-options timeout droppable?)
+apply-options timeout droppable? dealable?)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]