本文整理汇总了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)
示例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)
示例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)