[gnome-games] aisleriot: implement dealable feature in Cruel



commit 982651a3ae88c6b55207c24441a189d96579d9b0
Author: Vincent Povirk <madewokherd gmail com>
Date:   Sun Jun 14 22:47:45 2009 -0500

    aisleriot: implement dealable feature in Cruel
    
    bug #445955

 aisleriot/TODO            |    2 +-
 aisleriot/rules/cruel.scm |   16 ++++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/aisleriot/TODO b/aisleriot/TODO
index 7e2348e..98ff8bc 100644
--- a/aisleriot/TODO
+++ b/aisleriot/TODO
@@ -33,7 +33,7 @@ carpet                      DONE
 chessboard                  NOT NEEDED
 clock                       NOT NEEDED
 cover                       NOT NEEDED
-cruel                       possibly needed
+cruel                       DONE
 diamond_mine                NOT NEEDED
 doublets                    DONE
 eagle_wing                  DONE
diff --git a/aisleriot/rules/cruel.scm b/aisleriot/rules/cruel.scm
index 3329229..344db22 100644
--- a/aisleriot/rules/cruel.scm
+++ b/aisleriot/rules/cruel.scm
@@ -108,14 +108,18 @@
   )
 )
 
+(define (dealable?)
+  (not just-redealt)
+)
+
 (define (button-clicked slot-id)
-  (if (and (= stock slot-id) (not just-redealt))
-      (redeal)
-      #f
+  (and (= stock slot-id)
+       (dealable?)
+       (do-deal-next-cards)
   )
 )
 
-(define (redeal) 
+(define (do-deal-next-cards) 
   (for-each
     (lambda (x)
       (if (not (empty-slot? x))
@@ -231,8 +235,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]