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


Python IDataHolder.oldX方法代码示例

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


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

示例1: getScanInfos

# 需要导入模块: from ige.IDataHolder import IDataHolder [as 别名]
# 或者: from ige.IDataHolder.IDataHolder import oldX [as 别名]
	def getScanInfos(self, tran, obj, scanPwr, player):
		if obj.owner == player.oid:
			return []
		if scanPwr >= Rules.level1InfoScanPwr:
			result = IDataHolder()
			result._type = T_SCAN
			result.scanPwr = scanPwr
			result.oid = obj.oid
			result.x = obj.x
			result.y = obj.y
			result.oldX = obj.oldX
			result.oldY = obj.oldY
			result.eta = obj.eta
			result.signature = obj.signature
			result.type = obj.type
			result.orbiting = obj.orbiting
			if obj.orbiting == OID_NONE and obj.actionIndex < len(obj.actions):
				target = obj.actions[obj.actionIndex][1]
				targetObj = tran.db[target]
				if targetObj.type == T_PLANET:
					result.target = targetObj.compOf
				else:
					result.target = target
		else:
			return []
		if scanPwr >= Rules.level2InfoScanPwr:
			result.owner = obj.owner
			if obj.customname:
				result.name = obj.customname
			else:
				result.name = obj.name
		if scanPwr >= Rules.level3InfoScanPwr:
			result.isMilitary = obj.isMilitary
			result.combatPwr = obj.combatPwr
		if scanPwr >= Rules.level4InfoScanPwr:
			# provide less information
			result.shipScan = {}
			owner = tran.db[obj.owner]
			for designID, hp, shield, exp in obj.ships:
				tech = owner.shipDesigns[designID]
				key = tech.name, tech.combatClass, tech.isMilitary
				result.shipScan[key] = result.shipScan.get(key, 0) + 1
		if scanPwr >= Rules.partnerScanPwr:
			result.scannerPwr = obj.scannerPwr
			result.allowmerge = obj.allowmerge
			result.customname = obj.customname
			result.name = obj.name
		return [result]
开发者ID:OuterDeepSpace,项目名称:OuterDeepSpace,代码行数:50,代码来源:IFleet.py


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