本文整理汇总了Python中GameState.newGame方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.newGame方法的具体用法?Python GameState.newGame怎么用?Python GameState.newGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameState
的用法示例。
在下文中一共展示了GameState.newGame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import GameState [as 别名]
# 或者: from GameState import newGame [as 别名]
for s in settlements:
self.board.setSettlement(s.adjHex1, s.adjHex2, s.adjHex3, s.isCity, fill=self.playerColors[s.owner])
for i in range(nPlayers):
if self.hand_text[i]:
self.board.delete(self.hand_text[i])
p = game.players[i]
text = "player Id: {0}\nWOOL: {1}\nBRICK: {2}\nORE: {3}\nLUMBER: {4}\nGRAIN: {5}\nVictory Point: {6}\nPlayer Color: {7}".format(p.playerId, p.resources[ResourceType.WOOL], p.resources[ResourceType.BRICK], p.resources[ResourceType.ORE], p.resources[ResourceType.LUMBER], p.resources[ResourceType.GRAIN], p.vp(game), self.playerColors[i])
if game.turn.currentPlayer == p.playerId:
self.hand_text[i] = self.board.create_text(self.hand_positions[i], text=text, font = tkFont.Font(weight = 'bold'))
else:
self.hand_text[i] = self.board.create_text(self.hand_positions[i], text=text, fill = "#112233")
if self.explain_text:
self.board.delete(self.explain_text)
if explain:
if isinstance(explain, tuple):
explain = "Roll: {0}, {1}".format(*explain)
else:
explain = str(explain)
self.explain_text = self.board.create_text(self.explain_position, text=explain, anchor=NW)
if __name__ == "__main__":
args = map(int, sys.argv[1:])
if skip_to_good_part:
View(skipToGoodPart(*args))
else:
View(GameState.newGame(*args))