[gnome-nibbles] game: rename constants for clarity



commit 59829b81dafc4bbb3d0db251ce567d3eb40d4e6c
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Thu Aug 20 19:52:30 2015 +0300

    game: rename constants for clarity

 src/gnome-nibbles.vala |    4 ++--
 src/nibbles-game.vala  |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index f393c82..a24b55c 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -130,7 +130,7 @@ public class Nibbles : Gtk.Application
 
         settings = new Settings ("org.gnome.nibbles");
         worm_settings = new Gee.ArrayList<Settings> ();
-        for (int i = 0; i < NibblesGame.NUMWORMS; i++)
+        for (int i = 0; i < NibblesGame.MAX_WORMS; i++)
         {
             var name = "org.gnome.nibbles.worm%d".printf(i);
             worm_settings.add (new Settings (name));
@@ -159,7 +159,7 @@ public class Nibbles : Gtk.Application
         statusbar_stack = (Gtk.Stack) builder.get_object ("statusbar_stack");
         countdown = (Gtk.Label) builder.get_object ("countdown");
         number_of_players_buttons = new Gee.LinkedList<Gtk.ToggleButton> ();
-        for (int i = 0; i < NibblesGame.NUMHUMANS; i++)
+        for (int i = 0; i < NibblesGame.MAX_HUMANS; i++)
         {
             var button = (Gtk.ToggleButton) builder.get_object ("players%d".printf (i + 1));
             button.toggled.connect (change_number_of_players_cb);
diff --git a/src/nibbles-game.vala b/src/nibbles-game.vala
index 2386b1b..c087f48 100644
--- a/src/nibbles-game.vala
+++ b/src/nibbles-game.vala
@@ -29,9 +29,9 @@ public class NibblesGame : Object
     public const int GAMEDELAY = 35;
     public const int BONUSDELAY = 100;
 
-    public const int NUMHUMANS = 4;
-    public const int NUMAI = 0;
-    public const int NUMWORMS = NUMHUMANS + NUMAI;
+    public const int MAX_HUMANS = 4;
+    public const int MAX_AI = 5;
+    public const int MAX_WORMS = 6;
 
     public const int WIDTH = 92;
     public const int HEIGHT = 66;
@@ -53,7 +53,7 @@ public class NibblesGame : Object
     public WarpManager warp_manager;
 
     public int numhumans;
-    public int numai = NUMAI;
+    public int numai;
     public int numworms;
 
     public int speed = 2;


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