当前位置: 首页>>代码示例>>Python>>正文


Python GameModel.__init__方法代码示例

本文整理汇总了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"
开发者ID:ggjj1122,项目名称:pychess,代码行数:27,代码来源:ICGameModel.py

示例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
开发者ID:jskurka,项目名称:PyChess-Learning-Module,代码行数:17,代码来源:ICGameModel.py

示例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"
开发者ID:leogregianin,项目名称:pychess,代码行数:47,代码来源:ICGameModel.py

示例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"
开发者ID:oldstylejoe,项目名称:pychess-timed,代码行数:21,代码来源:ICGameModel.py


注:本文中的pychess.Utils.GameModel.GameModel.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。