[iagno] Don't allow AI to move while human is on the new game screen



commit f5696b9833d47fa96acd1626e3f4d829221b52d0
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Sep 24 22:34:13 2014 -0500

    Don't allow AI to move while human is on the new game screen
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664976

 src/iagno.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index de8235d..3307e75 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -267,6 +267,9 @@ public class Iagno : Gtk.Application
     {
         show_game_board ();
         back_action.set_enabled (false);
+
+        if (game.current_color != player_one && computer != null)
+            computer.move_async.begin (SLOW_MOVE_DELAY);
     }
 
     private void show_game_board ()
@@ -278,6 +281,9 @@ public class Iagno : Gtk.Application
 
     private void show_new_game_screen ()
     {
+        if (computer != null)
+            computer.cancel_move ();
+
         main_stack.set_visible_child_name ("start-box");
         back_button.sensitive = game != null;
         back_button.visible = true;


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