[gnome-chess] Remove engine ready signal
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Remove engine ready signal
- Date: Fri, 25 Dec 2020 14:22:01 +0000 (UTC)
commit 573d46538ce0bf11504839e79e2fe0d2964d71b6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Fri Dec 25 08:20:37 2020 -0600
Remove engine ready signal
All it does is queue an unneeded draw.
engine/chess-engine-cecp.vala | 1 -
engine/chess-engine-uci.vala | 2 --
engine/chess-engine.vala | 15 ---------------
src/gnome-chess.vala | 10 ----------
4 files changed, 28 deletions(-)
---
diff --git a/engine/chess-engine-cecp.vala b/engine/chess-engine-cecp.vala
index 4e9b5b0..203d00a 100644
--- a/engine/chess-engine-cecp.vala
+++ b/engine/chess-engine-cecp.vala
@@ -30,7 +30,6 @@ public class ChessEngineCECP : ChessEngine
write_line ("random");
foreach (var o in options)
write_line (o);
- ready = true;
}
public override void process_input (char[] data)
diff --git a/engine/chess-engine-uci.vala b/engine/chess-engine-uci.vala
index 89f5359..2782337 100644
--- a/engine/chess-engine-uci.vala
+++ b/engine/chess-engine-uci.vala
@@ -98,8 +98,6 @@ public class ChessEngineUCI : ChessEngine
case "readyok":
if (tokens.length != 1)
warning ("Unexpected arguments on readyok: %s", line);
-
- ready = true;
break;
case "bestmove":
diff --git a/engine/chess-engine.vala b/engine/chess-engine.vala
index 6b69895..170f609 100644
--- a/engine/chess-engine.vala
+++ b/engine/chess-engine.vala
@@ -29,7 +29,6 @@ public abstract class ChessEngine : Object
protected virtual void process_input (char[] data) {}
public signal void starting ();
- public signal void ready_changed ();
public signal void moved (string move);
public signal void resigned ();
public signal void stopped_unexpectedly ();
@@ -37,20 +36,6 @@ public abstract class ChessEngine : Object
public signal void claim_draw ();
public signal void offer_draw ();
- private bool _ready = false;
- public bool ready
- {
- protected set
- {
- _ready = value;
- ready_changed ();
- }
- public get
- {
- return _ready;
- }
- }
-
protected ChessEngine (string binary, string[] args, uint delay_seconds)
{
this.binary = binary;
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index f8dea9d..2b273a1 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -450,7 +450,6 @@ Copyright © 2015–2016 Sahil Sareen""";
if (opponent_engine != null)
{
opponent_engine.stop ();
- opponent_engine.ready_changed.disconnect (engine_ready_cb);
opponent_engine.moved.disconnect (engine_move_cb);
opponent_engine.resigned.disconnect (engine_resigned_cb);
opponent_engine.stopped_unexpectedly.disconnect (engine_stopped_unexpectedly_cb);
@@ -486,7 +485,6 @@ Copyright © 2015–2016 Sahil Sareen""";
}
else
{
- opponent_engine.ready_changed.connect (engine_ready_cb);
opponent_engine.moved.connect (engine_move_cb);
opponent_engine.resigned.connect (engine_resigned_cb);
opponent_engine.stopped_unexpectedly.connect (engine_stopped_unexpectedly_cb);
@@ -671,14 +669,6 @@ Copyright © 2015–2016 Sahil Sareen""";
return engine;
}
- private void engine_ready_cb (ChessEngine engine)
- {
- if (opponent_engine.ready)
- {
- view.queue_draw ();
- }
- }
-
private void do_engine_move (string move)
{
if (!opponent.move (move))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]