本文整理汇总了Python中game.table.Table.has_aka_dora方法的典型用法代码示例。如果您正苦于以下问题:Python Table.has_aka_dora方法的具体用法?Python Table.has_aka_dora怎么用?Python Table.has_aka_dora使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game.table.Table
的用法示例。
在下文中一共展示了Table.has_aka_dora方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_discard_tile_force_tsumogiri
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_discard_tile_force_tsumogiri(self):
table = Table()
table.has_aka_dora = True
player = table.player
tiles = self._string_to_136_array(sou='11134567', pin='456', man='45')
# 6p
tile = 57
player.init_hand(tiles)
player.draw_tile(tile)
discarded_tile = player.discard_tile()
self.assertEqual(discarded_tile, tile)
# add not red five pin
tiles = self._string_to_136_array(sou='11134567', pin='46', man='45') + [53]
tile = FIVE_RED_PIN
player.init_hand(tiles)
player.draw_tile(tile)
discarded_tile = player.discard_tile()
# WE DON'T NEED TO DISCARD RED FIVE
self.assertNotEqual(discarded_tile, tile)
示例2: test_keep_aka_dora_in_hand
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_keep_aka_dora_in_hand(self):
table = Table()
table.dora_indicators = [self._string_to_136_tile(pin='1')]
table.has_aka_dora = True
player = table.player
tiles = self._string_to_136_array(sou='12346', pin='34578', man='99')
# five sou, we can't get it from string (because from string it is always aka dora)
tiles += [89]
player.init_hand(tiles)
player.draw_tile(FIVE_RED_SOU)
# we had to keep red five and discard just 5s
discarded_tile = player.discard_tile()
self.assertNotEqual(discarded_tile, FIVE_RED_SOU)
示例3: test_call_riichi_with_good_wait_against_other_player_riichi
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_call_riichi_with_good_wait_against_other_player_riichi(self):
table = Table()
table.has_aka_dora = True
table.count_of_remaining_tiles = 60
table.player.scores = 25000
tiles = self._string_to_136_array(sou='123789', pin='23467', man='55')
table.player.init_hand(tiles)
table.player.draw_tile(self._string_to_136_tile(man='9'))
table.add_called_riichi(3)
discard = table.player.discard_tile()
self.assertEqual(self._to_string([discard]), '9m')
self.assertEqual(table.player.ai.in_defence, False)
self.assertEqual(table.player.can_call_riichi(), True)
示例4: test_choose_best_option_with_melds
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_choose_best_option_with_melds(self):
table = Table()
player = table.player
table.has_aka_dora = False
tiles = self._string_to_136_array(sou='245666789', honors='2266')
player.init_hand(tiles)
meld = self._make_meld(Meld.PON, sou='666')
player.add_called_meld(meld)
meld = self._make_meld(Meld.CHI, sou='789')
player.add_called_meld(meld)
player.draw_tile(self._string_to_136_tile(sou='5'))
discarded_tile = player.discard_tile()
# we should discard best ukeire option here - 2s
self.assertEqual(self._to_string([discarded_tile]), '2s')
示例5: test_should_go_for_defence_and_good_hand_with_drawn_tile
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_should_go_for_defence_and_good_hand_with_drawn_tile(self):
"""
When we have 14 tiles in hand and someone declared a riichi
"""
table = Table()
table.has_aka_dora = True
tiles = self._string_to_136_array(sou='2223457899', honors='666')
table.player.init_hand(tiles)
table.player.draw_tile(self._string_to_136_tile(man='8'))
table.player.add_called_meld(self._make_meld(Meld.PON, sou='222'))
table.player.add_called_meld(self._make_meld(Meld.PON, honors='666'))
self.assertEqual(table.player.ai.defence.should_go_to_defence_mode(), False)
table.add_called_riichi(3)
result = table.player.discard_tile()
self.assertEqual(self._to_string([result]), '8m')
示例6: test_choose_best_wait_with_melds
# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import has_aka_dora [as 别名]
def test_choose_best_wait_with_melds(self):
table = Table()
player = table.player
table.has_aka_dora = False
tiles = self._string_to_136_array(sou='1222233455599')
player.init_hand(tiles)
meld = self._make_meld(Meld.CHI, sou='123')
player.add_called_meld(meld)
meld = self._make_meld(Meld.PON, sou='222')
player.add_called_meld(meld)
meld = self._make_meld(Meld.PON, sou='555')
player.add_called_meld(meld)
player.draw_tile(self._string_to_136_tile(sou='4'))
discarded_tile = player.discard_tile()
# double-pairs wait becomes better, because it has 4 tiles to wait for
# against just 1 in ryanmen
self.assertEqual(self._to_string([discarded_tile]), '3s')