game_testing.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Hanabi-AI 作者: MeGotsThis 项目源码 文件源码
def message_sent(self, mtype, data):
        if mtype == 'game_start':
            pass
        elif mtype == 'init':
            self.game = Game(self.connection, Variant(data['variant']),
                             data['names'], self.position, self.botcls,
                             **self.botkwargs)
            self.bot = self.game.bot
            self.connection.game = self.game
            self.connection.bot = self.bot
        elif self.game is not None:
            if mtype == 'notify' and data['type'] == 'draw':
                card = TestCard(Suit(data['suit']), Rank(data['rank']),
                                data['order'])
                self.deck[data['order']] = card
            self.game.received(mtype, data)
        elif mtype == 'notify' and data['type'] == 'reveal':
            pass
        elif mtype == 'action':
            pass
        else:
            print(mtype, data)
            raise Exception()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号