本文整理汇总了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]