[four-in-a-row] Remove unused variable.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [four-in-a-row] Remove unused variable.
- Date: Sat, 21 Dec 2019 16:37:46 +0000 (UTC)
commit 7147d36e238c07f50f1e425025bf717799d3da38
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Dec 21 15:14:31 2019 +0100
Remove unused variable.
src/four-in-a-row.vala | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
---
diff --git a/src/four-in-a-row.vala b/src/four-in-a-row.vala
index 19b94f2..7438281 100644
--- a/src/four-in-a-row.vala
+++ b/src/four-in-a-row.vala
@@ -41,7 +41,6 @@ private class FourInARow : Gtk.Application
// game status
private bool gameover = true;
- private bool player_active = false;
private PlayerID player = PlayerID.PLAYER1;
private PlayerID winner = PlayerID.NOBODY;
private PlayerID last_first_player = PlayerID.NOBODY;
@@ -289,7 +288,6 @@ private class FourInARow : Gtk.Application
}
gameover = true;
- player_active = false;
winner = NOBODY;
column = 3;
column_moveto = 3;
@@ -365,8 +363,6 @@ private class FourInARow : Gtk.Application
private void prompt_player ()
{
bool human = is_player_human ();
- string who;
- string str;
window.allow_hint (human && !gameover);
@@ -403,25 +399,15 @@ private class FourInARow : Gtk.Application
}
else
{
+ string who;
if (gameover)
- {
who = player == PLAYER1 ? theme_get_player_win (PlayerID.PLAYER1)
: theme_get_player_win (PlayerID.PLAYER2);
- str = _(who);
- }
- else if (player_active)
- {
- set_status_message (_("Your Turn"));
- return;
- }
else
- {
who = player == PLAYER1 ? theme_get_player_turn (PlayerID.PLAYER1)
: theme_get_player_turn (PlayerID.PLAYER2);
- str = _(who);
- }
- set_status_message (str);
+ set_status_message (_(who));
}
}
@@ -804,8 +790,7 @@ private class FourInARow : Gtk.Application
private inline bool on_key_press (Gdk.EventKey e)
{
- if (player_active
- || timeout != 0
+ if (timeout != 0
|| (e.keyval != Prefs.instance.keypress_left
&& e.keyval != Prefs.instance.keypress_right
&& e.keyval != Prefs.instance.keypress_drop))
@@ -835,9 +820,6 @@ private class FourInARow : Gtk.Application
private inline bool column_clicked_cb (int column)
{
- if (player_active)
- return false;
-
if (gameover && timeout == 0)
blink_winner (2);
else if (is_player_human () && timeout == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]