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()
评论列表
文章目录