本文整理匯總了Python中PlayerUtil.getPossibleWars方法的典型用法代碼示例。如果您正苦於以下問題:Python PlayerUtil.getPossibleWars方法的具體用法?Python PlayerUtil.getPossibleWars怎麽用?Python PlayerUtil.getPossibleWars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PlayerUtil
的用法示例。
在下文中一共展示了PlayerUtil.getPossibleWars方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: showSituationReport
# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getPossibleWars [as 別名]
#.........這裏部分代碼省略.........
bDefPacts = True
self.initIconGrid(screen, bVassals, bDefPacts)
self.initPower()
activePlayer = gc.getPlayer(self.iActivePlayer)
# Assemble the panel
iPANEL_X = 5
iPANEL_Y = 60
iPANEL_WIDTH = self.W_SCREEN - 20
iPANEL_HEIGHT = self.H_SCREEN - 120
self.tradePanel = self.getNextWidgetName()
screen.addPanel(self.tradePanel, "", "", True, True, iPANEL_X, iPANEL_Y, iPANEL_WIDTH, iPANEL_HEIGHT, PanelStyles.PANEL_STYLE_MAIN )
self.iconGrid.createGrid()
self.iconGrid.clearData()
iRow = 0
for iLoopPlayer in range(gc.getMAX_PLAYERS()):
pPlayer = gc.getPlayer(iLoopPlayer)
if (pPlayer.isAlive()
and (gc.getTeam(pPlayer.getTeam()).isHasMet(gc.getPlayer(self.iActivePlayer).getTeam())
or gc.getGame().isDebugMode())
and iLoopPlayer != self.iActivePlayer
and not pPlayer.isBarbarian()
and not pPlayer.isMinorCiv()):
# szPlayerName = pPlayer.getName() + "/" + pPlayer.getCivilizationShortDescription(0)
# BugUtil.debug("Grid_ThreatIndex - Start %i %s" % (iLoopPlayer, szPlayerName))
# BugUtil.debug("Grid_ThreatIndex - Start %i" % (iLoopPlayer))
self.iconGrid.appendRow(pPlayer.getCivilizationShortDescription(0), "", 3)
# add leaderhead icon
self.iconGrid.addIcon(iRow, self.Col_Leader,
gc.getLeaderHeadInfo(pPlayer.getLeaderType()).getButton(), 64,
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, self.iActivePlayer)
# add worst enemy
self.Grid_WorstEnemy(iRow, iLoopPlayer)
# add current war opponents
pActiveWars = PlayerUtil.getActiveWars(iLoopPlayer, self.iActivePlayer)
bCurrentWar = len(pActiveWars) > 0
for pLoopPlayer in pActiveWars:
self.iconGrid.addIcon(iRow, self.Col_Curr_Wars,
gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32,
*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))
# show vassals
if bVassals:
for pLoopPlayer in pVassals[iLoopPlayer]:
self.iconGrid.addIcon(iRow, self.Col_Vassals,
gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32,
*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))
# show defensive pacts
if bDefPacts:
for pLoopPlayer in pDefPacts[iLoopPlayer]:
self.iconGrid.addIcon(iRow, self.Col_DefPacts,
gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32,
*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))
# show players that the current player will declare on
bWHEOOH, pPossibleWars = PlayerUtil.getPossibleWars(iLoopPlayer, self.iActivePlayer)
for pLoopPlayer in pPossibleWars:
self.iconGrid.addIcon(iRow, self.Col_WillDeclareOn,
gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32,
*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))
# show WHEOOH
if bWHEOOH:
sWHEOOH = u" %c" % CyGame().getSymbolID(FontSymbols.OCCUPATION_CHAR)
else:
sWHEOOH = ""
# show possible trade embargos
pPossibleEmbargos = PlayerUtil.getPossibleEmbargos(iLoopPlayer, self.iActivePlayer)
for pLoopPlayer in pPossibleEmbargos:
self.iconGrid.addIcon(iRow, self.Col_WillEmbargo,
gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32,
*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))
self.iconGrid.setText(iRow, self.Col_WHEOOH, sWHEOOH, 3)
# add the threat index
self.Grid_ThreatIndex(iRow, iLoopPlayer, bCurrentWar, bWHEOOH)
iRow += 1
self.iconGrid.refresh()
self.drawTabs()
self.timer.log("SitRep")