[gnome-mines/wip/theming-support] Prepare model and view for previewing
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines/wip/theming-support] Prepare model and view for previewing
- Date: Sun, 4 Jan 2015 00:59:43 +0000 (UTC)
commit 432904d5243cdf114033c1d70d023426e4e51b3c
Author: Robert Roth <robert roth off gmail com>
Date: Sun Jan 4 02:57:51 2015 +0200
Prepare model and view for previewing
src/minefield-view.vala | 11 +++--------
src/minefield.vala | 4 ++--
2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 3c6f4a4..b3982b5 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -291,10 +291,7 @@ public class MinefieldView : Gtk.Grid
unlook ();
if (minefield.is_cleared (selected.x, selected.y))
- {
multi_release (selected.x, selected.y);
- redraw_adjacent (selected.x, selected.y);
- }
else if (minefield.get_flag (selected.x, selected.y) != FlagType.FLAG)
minefield.clear_mine (selected.x, selected.y);
@@ -408,7 +405,7 @@ public class MinefieldView : Gtk.Grid
}
}
- private void toggle_mark (uint x, uint y)
+ public void toggle_mark (uint x, uint y)
{
if (minefield.is_cleared (x, y))
return;
@@ -462,7 +459,7 @@ public class MinefieldView : Gtk.Grid
}
}
- private void multi_release (uint x, uint y)
+ public void multi_release (uint x, uint y)
{
if (!minefield.is_cleared (x, y) || minefield.get_flag (x, y) == FlagType.FLAG)
return;
@@ -509,6 +506,7 @@ public class MinefieldView : Gtk.Grid
else
m.set_flag (nx, ny, FlagType.FLAG);
}
+ redraw_adjacent (x, y);
}
public override bool key_press_event (Gdk.EventKey event)
@@ -608,10 +606,7 @@ public class MinefieldView : Gtk.Grid
unlook ();
if (minefield.is_cleared (selected.x, selected.y))
- {
multi_release (selected.x, selected.y);
- redraw_adjacent (selected.x, selected.y);
- }
else if (minefield.get_flag (selected.x, selected.y) != FlagType.FLAG)
minefield.clear_mine (selected.x, selected.y);
diff --git a/src/minefield.vala b/src/minefield.vala
index e4defd4..97f005d 100644
--- a/src/minefield.vala
+++ b/src/minefield.vala
@@ -15,7 +15,7 @@ public enum FlagType
MAYBE
}
-private class Location : Object
+protected class Location : Object
{
/* true if contains a mine */
public bool has_mine = false;
@@ -55,7 +55,7 @@ public class Minefield : Object
public uint n_mines = 0;
/* State of each location */
- private Location[,] locations;
+ protected Location[,] locations;
/* true if have hit a mine */
public bool exploded = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]