[iagno] Simplify variable use.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno] Simplify variable use.
- Date: Fri, 13 Mar 2015 04:41:28 +0000 (UTC)
commit 8576de972662bfae6a18dee97eeff6171b2b0382
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Mar 13 05:41:14 2015 +0100
Simplify variable use.
src/iagno.vala | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index fcda2a6..256ca8f 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -28,7 +28,6 @@ public class Iagno : Gtk.Application
private static bool alternative_start;
private static string? level = null;
private static int size = 8;
- private static bool start_now = false; // could be replaced one day with (two_players != null)
private static string color; // TODO Player
private static bool? sound = null;
private static bool? two_players = null;
@@ -123,15 +122,12 @@ public class Iagno : Gtk.Application
if (options.contains ("two-players")) {
two_players = true;
- start_now = true;
} else if (options.contains ("first")) {
color = "dark";
two_players = false;
- start_now = true;
} else if (options.contains ("second")) {
color = "light";
two_players = false;
- start_now = true;
}
/* Activate */
@@ -148,7 +144,8 @@ public class Iagno : Gtk.Application
if (sound != null)
settings.set_boolean ("sound", sound);
- if (two_players != null)
+ bool start_now = two_players != null;
+ if (start_now)
settings.set_int ("num-players", two_players ? 2 : 1);
else /* hack, part 1 of 4 */
two_players = (settings.get_int ("num-players") == 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]