本文整理匯總了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))