[gnome-mahjongg] Add Game.reset_clock()
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg] Add Game.reset_clock()
- Date: Thu, 20 Feb 2014 04:16:11 +0000 (UTC)
commit fb67b2b5f7ee82efcb6fe3e9834518a8621a5664
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Feb 19 19:24:29 2014 -0600
Add Game.reset_clock()
Simplifies the implementation of Game.reset()
src/game.vala | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/game.vala b/src/game.vala
index 72091e2..87baad5 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -252,9 +252,7 @@ public class Game
public void reset ()
{
- stop_clock ();
- clock = null;
- clock_elapsed = 0.0;
+ reset_clock ();
selected_tile = null;
set_hint (null, null);
foreach (var tile in tiles)
@@ -454,6 +452,13 @@ public class Game
timeout_cb ();
}
+ private void reset_clock ()
+ {
+ stop_clock ();
+ clock = null;
+ clock_elapsed = 0.0;
+ }
+
private bool timeout_cb ()
{
/* Notify on the next tick */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]