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


Python Game.addPlayer方法代码示例

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


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

示例1: test_rotatesPlayersCorrectly

# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import addPlayer [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)
开发者ID:mcpate,项目名称:CS594-GameProtocol,代码行数:9,代码来源:game_unittest.py

示例2: test_returnsRotationOfPlayers

# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import addPlayer [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)
开发者ID:mcpate,项目名称:CS594-GameProtocol,代码行数:12,代码来源:game_unittest.py

示例3: test_dealCardsDealsCorrectly

# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import addPlayer [as 别名]
 def test_dealCardsDealsCorrectly(self):
     deck = Deck()
     game = Game('SomeGameName', self.m)
     game.addPlayer(self.j)  # This isn't really necessary.
     game.dealCards([self.m, self.j], deck)
     self.assertEqual(self.m.hand.size(), 3)
     self.assertEqual(self.m.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(self.j.hand.size(), 3)
     self.assertEqual(self.j.up.size(), 3)
     self.assertEqual(self.m.down.size(), 3)
     self.assertEqual(deck.size(), (52 - 18))
开发者ID:mcpate,项目名称:CS594-GameProtocol,代码行数:14,代码来源:game_unittest.py


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