1from gi.repository import GObject
2
3from pychess.Players.Engine import Engine
4from pychess.Utils.const import NORMAL, ANALYZING, INVERSE_ANALYZING
5
6TIME_OUT_SECOND = 60
7
8
9class ProtocolEngine(Engine):
10
11    __gsignals__ = {
12        "readyForOptions": (GObject.SignalFlags.RUN_FIRST, None, ()),
13        "readyForMoves": (GObject.SignalFlags.RUN_FIRST, None, ())
14    }
15
16    # Setting engine options
17
18    def __init__(self, subprocess, color, protover, md5):
19        Engine.__init__(self, md5)
20
21        self.engine = subprocess
22        self.defname = subprocess.defname
23        self.color = color
24        self.protover = protover
25
26        self.readyMoves = False
27        self.readyOptions = False
28
29        self.connected = True
30        self.mode = NORMAL
31        self.analyzing_paused = False
32
33    def isAnalyzing(self):
34        return self.mode in (ANALYZING, INVERSE_ANALYZING)
35