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


Python Table.set_players_scores方法代码示例

本文整理汇总了Python中game.table.Table.set_players_scores方法的典型用法代码示例。如果您正苦于以下问题:Python Table.set_players_scores方法的具体用法?Python Table.set_players_scores怎么用?Python Table.set_players_scores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在game.table.Table的用法示例。


在下文中一共展示了Table.set_players_scores方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_set_scores

# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import set_players_scores [as 别名]
    def test_set_scores(self):
        table = Table()
        table.init_round(0, 0, 0, 0, 0, [])
        scores = [230, 110, 55, 405]

        table.set_players_scores(scores)

        self.assertEqual(table.get_player(0).scores, 23000)
        self.assertEqual(table.get_player(1).scores, 11000)
        self.assertEqual(table.get_player(2).scores, 5500)
        self.assertEqual(table.get_player(3).scores, 40500)
开发者ID:MahjongRepository,项目名称:tenhou-python-bot,代码行数:13,代码来源:tests_table.py

示例2: test_set_scores_and_uma

# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import set_players_scores [as 别名]
    def test_set_scores_and_uma(self):
        table = Table()
        table.init_round(0, 0, 0, 0, 0, [])
        scores = [230, 110, 55, 405]
        uma = [-17, 3, 48, -34]

        table.set_players_scores(scores, uma)

        self.assertEqual(table.get_player(0).scores, 23000)
        self.assertEqual(table.get_player(0).uma, -17)
        self.assertEqual(table.get_player(1).scores, 11000)
        self.assertEqual(table.get_player(1).uma, 3)
        self.assertEqual(table.get_player(2).scores, 5500)
        self.assertEqual(table.get_player(2).uma, 48)
        self.assertEqual(table.get_player(3).scores, 40500)
        self.assertEqual(table.get_player(3).uma, -34)
开发者ID:MahjongRepository,项目名称:tenhou-python-bot,代码行数:18,代码来源:tests_table.py

示例3: test_set_scores_and_recalculate_player_position

# 需要导入模块: from game.table import Table [as 别名]
# 或者: from game.table.Table import set_players_scores [as 别名]
    def test_set_scores_and_recalculate_player_position(self):
        table = Table()
        table.init_round(0, 0, 0, 0, 0, [])

        self.assertEqual(table.get_player(0).first_seat, 0)
        self.assertEqual(table.get_player(1).first_seat, 1)
        self.assertEqual(table.get_player(2).first_seat, 2)
        self.assertEqual(table.get_player(3).first_seat, 3)

        scores = [230, 110, 55, 405]
        table.set_players_scores(scores)

        self.assertEqual(table.get_player(0).position, 2)
        self.assertEqual(table.get_player(1).position, 3)
        self.assertEqual(table.get_player(2).position, 4)
        self.assertEqual(table.get_player(3).position, 1)

        scores = [110, 110, 405, 405]
        table.set_players_scores(scores)

        self.assertEqual(table.get_player(0).position, 3)
        self.assertEqual(table.get_player(1).position, 4)
        self.assertEqual(table.get_player(2).position, 1)
        self.assertEqual(table.get_player(3).position, 2)
开发者ID:MahjongRepository,项目名称:tenhou-python-bot,代码行数:26,代码来源:tests_table.py


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