本文整理汇总了Python中Statistics.Statistics.getInfos方法的典型用法代码示例。如果您正苦于以下问题:Python Statistics.getInfos方法的具体用法?Python Statistics.getInfos怎么用?Python Statistics.getInfos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistics.Statistics
的用法示例。
在下文中一共展示了Statistics.getInfos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getVehicleTypeAmount
# 需要导入模块: from Statistics import Statistics [as 别名]
# 或者: from Statistics.Statistics import getInfos [as 别名]
def getVehicleTypeAmount(self):
from Statistics import Statistics
player = BigWorld.player()
vehicles = player.arena.vehicles
if player.playerVehicleID not in vehicles:
return
curVeh = vehicles[player.playerVehicleID]
Statistics.getInfos(curVeh['accountDBID'])
vehicles[player.playerVehicleID]['team']
amounts = {VEHICLE_CLASS_NAME.HEAVY_TANK:{'ally':0,'enemy':0},
VEHICLE_CLASS_NAME.MEDIUM_TANK:{'ally':0,'enemy':0},
VEHICLE_CLASS_NAME.LIGHT_TANK:{'ally':0,'enemy':0},
VEHICLE_CLASS_NAME.AT_SPG:{'ally':0,'enemy':0},
VEHICLE_CLASS_NAME.SPG:{'ally':0,'enemy':0}}
tiers = []
for accountDBID,entityObj in Statistics.getEmo().getAll().iteritems():
vID = g_sessionProvider.getCtx().getVehIDByAccDBID(accountDBID)
if vID in vehicles:
v_info = vehicles[vID]
tiers.append(v_info['vehicleType'].level)
if not BattleUtils.isMyTeam(v_info['team']):
tag = 'enemy'
else:
tag = 'ally'
for vehicleType in VEHICLE_TYPES_ORDER:
if vehicleType in v_info['vehicleType'].type.tags:
amounts[vehicleType][tag] += 1
currentTier = curVeh['vehicleType'].level
return (amounts,tiers,currentTier)