本文整理汇总了Python中lib.game.Game.beginGame方法的典型用法代码示例。如果您正苦于以下问题:Python Game.beginGame方法的具体用法?Python Game.beginGame怎么用?Python Game.beginGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.game.Game
的用法示例。
在下文中一共展示了Game.beginGame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_rotatesPlayersCorrectly
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import beginGame [as 别名]
def test_rotatesPlayersCorrectly(self):
game = Game("SomeGameName", self.m)
game.addPlayer(self.j)
game.beginGame()
self.assertRegex(game.currentPlayer.name, self.j.name)
game.rotateCurrentPlayer()
self.assertRegex(game.currentPlayer.name, self.m.name)
示例2: test_returnsRotationOfPlayers
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import beginGame [as 别名]
def test_returnsRotationOfPlayers(self):
game = Game("SomeGame", self.m)
game.addPlayer(self.j)
game.beginGame()
self.assertEqual(len(game.currentTurn), 1)
self.assertRegex(game.currentPlayer.name, self.j.name)
nextPlayer = game.getNextPlayer()
self.assertRegex(nextPlayer.name, self.m.name)
nextPlayer = game.getNextPlayer()
self.assertRegex(nextPlayer.name, self.j.name)