當前位置: 首頁>>代碼示例>>Python>>正文


Python PlayerUtil.getActivePlayer方法代碼示例

本文整理匯總了Python中PlayerUtil.getActivePlayer方法的典型用法代碼示例。如果您正苦於以下問題:Python PlayerUtil.getActivePlayer方法的具體用法?Python PlayerUtil.getActivePlayer怎麽用?Python PlayerUtil.getActivePlayer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PlayerUtil的用法示例。


在下文中一共展示了PlayerUtil.getActivePlayer方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: reset

# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActivePlayer [as 別名]
	def reset(self):
		"Clears state kept for each city."
		#DLP
		if CyGame().isPitbossHost():
			return
		self._beforeReset()
		player = PlayerUtil.getActivePlayer()
		for city in PlayerUtil.playerCities(player):
			self.resetCity(city)
開發者ID:DarkLunaPhantom,項目名稱:civ4ffplus,代碼行數:11,代碼來源:Civ4lerts.py

示例2: getSaveFileName

# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActivePlayer [as 別名]
def getSaveFileName(pathName):
	if pathName:
		activePlayer = PlayerUtil.getActivePlayer()
		if not MapFinder.isActive() and options.isUsePlayerName():
			fileName = activePlayer.getName()
			turnYear = CyGameTextMgr().getTimeStr(gc.getGame().getGameTurn(), False)
			fileName += '_' + turnYear.replace(" ", "-")
		else:
			objLeaderHead = gc.getLeaderHeadInfo (activePlayer.getLeaderType()).getText()
			
			game = gc.getGame()
			map = gc.getMap()
			
			difficulty = gc.getHandicapInfo(activePlayer.getHandicapType()).getText()
			mapType = os.path.basename(map.getMapScriptName())
			mapSize = gc.getWorldInfo(map.getWorldSize()).getText()
			mapClimate = gc.getClimateInfo(map.getClimate()).getText()
			mapLevel = gc.getSeaLevelInfo(map.getSeaLevel()).getText()
			era = gc.getEraInfo(game.getStartEra()).getText()
			speed = gc.getGameSpeedInfo(game.getGameSpeedType()).getText()
			turnYear = CyGameTextMgr().getTimeStr(game.getGameTurn(), False)
			turnYear = turnYear.replace(" ", "-")
			turnYear = turnYear.replace(",", "-")

			fileName = objLeaderHead[0:3]
			fileName += '_' + difficulty[0:3]
			fileName += '_' + mapSize[0:3]
			fileName += '_' + mapType[0:3]
			fileName += '_' + speed[0:3]
			fileName += '_' + era[0:3]
			fileName += '_' + turnYear
			fileName += '_' + mapClimate[0:3]
			fileName += '_' + mapLevel[0:3]

		fileName = BugPath.join(pathName, fileName)
		baseFileName = CvUtil.convertToStr(fileName)
		fileName = CvUtil.convertToStr(fileName + '_' + time.strftime("%b-%d-%Y_%H-%M-%S"))

		return (fileName, baseFileName)
開發者ID:AP-ML,項目名稱:DTM,代碼行數:41,代碼來源:AutoSave.py

示例3: getHoverText

# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActivePlayer [as 別名]
def getHoverText(eWidgetType, iData1, iData2, bOption):
	city, iTurns = getDisplayCity()
	if (not city):
		# no rate or progress in any city and no city selected
		return BugUtil.getText("TXT_KEY_MISC_GREAT_PERSON", (0, PlayerUtil.getActivePlayer().greatPeopleThreshold(False)))
	iThreshold = gc.getPlayer(city.getOwner()).greatPeopleThreshold(False)
	iProgress = city.getGreatPeopleProgress()
	iRate = city.getGreatPeopleRate()
	szText = BugUtil.colorText(city.getName(), "COLOR_HIGHLIGHT_TEXT")
	szText += u"\n"
	szText += BugUtil.getText("TXT_KEY_MISC_GREAT_PERSON", (iProgress, iThreshold))
	if (iRate > 0):
		szText += u"\n%d%s%s " % (iRate, g_gpIcon, BugUtil.getPlainText("TXT_KEY_PER_TURN"))
		szText += BugUtil.getText("INTERFACE_CITY_TURNS", (iTurns,))
	
	percents = calcPercentages(city)
	if (len(percents) > 0):
		percents.sort()
		percents.reverse()
		szText += u"\n"
		for iPercent, iUnit in percents:
#			iUnit = getUnitType(gpType)
			szText += u"\n%s%s - %d%%" % (getUnitIcon(iUnit), gc.getUnitInfo(iUnit).getDescription(), iPercent)
	return szText
開發者ID:AP-ML,項目名稱:DTM,代碼行數:26,代碼來源:GPUtil.py

示例4: reset

# 需要導入模塊: import PlayerUtil [as 別名]
# 或者: from PlayerUtil import getActivePlayer [as 別名]
	def reset(self):
		"Clears state kept for each city."
		self._beforeReset()
		player = PlayerUtil.getActivePlayer()
		for city in PlayerUtil.playerCities(player):
			self.resetCity(city)
開發者ID:Alrik2002,項目名稱:Civ4-MMod,代碼行數:8,代碼來源:Civ4lerts.py


注:本文中的PlayerUtil.getActivePlayer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。