本文整理汇总了Python中pychess.Utils.GameModel.GameModel.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python GameModel.__init__方法的具体用法?Python GameModel.__init__怎么用?Python GameModel.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pychess.Utils.GameModel.GameModel
的用法示例。
在下文中一共展示了GameModel.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pychess.Utils.GameModel import GameModel [as 别名]
# 或者: from pychess.Utils.GameModel.GameModel import __init__ [as 别名]
def __init__ (self, connection, ficsgame, timemodel):
assert ficsgame.game_type in GAME_TYPES.values()
GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
self.connection = connection
self.ficsgame = ficsgame
self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
self.gmwidg_ready = threading.Event()
connections = self.connections
connections[connection.bm].append(connection.bm.connect("boardUpdate", self.onBoardUpdate))
connections[connection.bm].append(connection.bm.connect("obsGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("curGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("gamePaused", self.onGamePaused))
connections[connection.bm].append(connection.bm.connect("madeExamined", self.onMadeExamined))
connections[connection.bm].append(connection.bm.connect("madeUnExamined", self.onMadeUnExamined))
connections[connection.om].append(connection.om.connect("onActionError", self.onActionError))
connections[connection.cm].append(connection.cm.connect("kibitzMessage", self.onKibitzMessage))
connections[connection.cm].append(connection.cm.connect("whisperMessage", self.onWhisperMessage))
connections[connection.cm].append(connection.cm.connect("observers_received", self.onObserversReceived))
connections[connection].append(connection.connect("disconnected", self.onDisconnected))
rated = "rated" if ficsgame.rated else "unrated"
# This is in the format that ficsgames.org writes these PGN headers
self.tags["Event"] = "FICS %s %s game" % (rated, ficsgame.game_type.fics_name)
self.tags["Site"] = "freechess.org"
示例2: __init__
# 需要导入模块: from pychess.Utils.GameModel import GameModel [as 别名]
# 或者: from pychess.Utils.GameModel.GameModel import __init__ [as 别名]
def __init__ (self, connection, gameno, timemodel, variant, rated=False):
GameModel.__init__(self, timemodel, variant)
self.connection = connection
self.gameno = gameno
connections = self.connections
connections[connection.bm].append(connection.bm.connect("boardUpdate", self.onBoardUpdate))
connections[connection.bm].append(connection.bm.connect("obsGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("curGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("gamePaused", self.onGamePaused))
connections[connection.om].append(connection.om.connect("onActionError", self.onActionError))
connections[connection].append(connection.connect("disconnected", self.onDisconnected))
self.inControl = True
self.rated = rated
示例3: __init__
# 需要导入模块: from pychess.Utils.GameModel import GameModel [as 别名]
# 或者: from pychess.Utils.GameModel.GameModel import __init__ [as 别名]
def __init__(self, connection, ficsgame, timemodel):
assert ficsgame.game_type in GAME_TYPES.values()
GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
self.connection = connection
self.ficsgame = ficsgame
self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
self.gmwidg_ready = asyncio.Event()
self.kibitz_task = None
self.disconnected = False
connections = self.connections
connections[connection.bm].append(connection.bm.connect(
"boardSetup", self.onBoardSetup))
connections[connection.bm].append(connection.bm.connect(
"exGameReset", self.onExGameReset))
connections[connection.bm].append(connection.bm.connect(
"gameUndoing", self.onGameUndoing))
connections[connection.bm].append(connection.bm.connect(
"timesUpdate", self.onTimesUpdate))
connections[connection.bm].append(connection.bm.connect(
"obsGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect(
"curGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect(
"gamePaused", self.onGamePaused))
connections[connection.bm].append(connection.bm.connect(
"madeExamined", self.onMadeExamined))
connections[connection.bm].append(connection.bm.connect(
"madeUnExamined", self.onMadeUnExamined))
connections[connection.om].append(connection.om.connect(
"onActionError", self.onActionError))
connections[connection.cm].append(connection.cm.connect(
"kibitzMessage", self.onKibitzMessage))
connections[connection.cm].append(connection.cm.connect(
"whisperMessage", self.onWhisperMessage))
connections[connection.cm].append(connection.cm.connect(
"observers_received", self.onObserversReceived))
connections[connection].append(connection.connect("disconnected",
self.onDisconnected))
rated = "rated" if ficsgame.rated else "unrated"
# This is in the format that ficsgames.org writes these PGN headers
ics = "ICC" if self.connection.ICC else "FICS"
self.tags["Event"] = "%s %s %s game" % (ics, rated, ficsgame.game_type.fics_name)
self.tags["Site"] = "chessclub.com" if self.connection.ICC else "freechess.org"
示例4: __init__
# 需要导入模块: from pychess.Utils.GameModel import GameModel [as 别名]
# 或者: from pychess.Utils.GameModel.GameModel import __init__ [as 别名]
def __init__(self, connection, ficsgame, timemodel):
assert ficsgame.game_type in GAME_TYPES.values()
GameModel.__init__(self, timemodel, ficsgame.game_type.variant)
self.connection = connection
self.ficsgame = ficsgame
self.ficsplayers = (ficsgame.wplayer, ficsgame.bplayer)
connections = self.connections
connections[connection.bm].append(connection.bm.connect("boardUpdate", self.onBoardUpdate))
connections[connection.bm].append(connection.bm.connect("obsGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("curGameEnded", self.onGameEnded))
connections[connection.bm].append(connection.bm.connect("gamePaused", self.onGamePaused))
connections[connection.om].append(connection.om.connect("onActionError", self.onActionError))
connections[connection].append(connection.connect("disconnected", self.onDisconnected))
rated = "rated" if ficsgame.rated else "unrated"
# This is in the format that ficsgames.org writes these PGN headers
self.tags["Event"] = "FICS %s %s game" % (rated, ficsgame.game_type.fics_name)
self.tags["Site"] = "FICS"