本文整理汇总了Python中StatValues.requestSeedData方法的典型用法代码示例。如果您正苦于以下问题:Python StatValues.requestSeedData方法的具体用法?Python StatValues.requestSeedData怎么用?Python StatValues.requestSeedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatValues
的用法示例。
在下文中一共展示了StatValues.requestSeedData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import StatValues [as 别名]
# 或者: from StatValues import requestSeedData [as 别名]
def main():
buildlist = []
#loopthrough the files
for k in range (1):
seedJSON = StatValues.requestSeedData(1)
for i in range(len(seedJSON["matches"])):
match = seedJSON["matches"][i]
matchframes = match["timeline"]["frames"]
#loop through each participant
for j in range (1,10):
team = 0
if j < 6:
team == 1
else:
team == 2
#sums of individual stats
singleGamelistAD = statSum(matchframes, "FlatPhysicalDamageMod", team)
singleGamelistHP = statSum(matchframes, "FlatHPPoolMod", team)
singleGamelistAP = statSum(matchframes, "FlatMagicDamageMod", team)
singleGamelistARM = statSum(matchframes, "FlatArmorMod", team)
singleGamelistCRIT = statSum(matchframes, "FlatCritChanceMod", team)
singleGamelistMR = statSum(matchframes, "FlatSpellBlockMod", team)
singleGamelistAS = statSum(matchframes, "PercentAttackSpeedMod", team)
#loop through the timeline sums
for t in range (len(singleGamelistAD)):
#aggregates stats into "effective stats"
champid = match["participants"][j]["championId"]
AD = singleGamelistAD[t] + singleGamelistAD[t] * singleGamelistAS[t] + singleGamelistAD[t] * singleGamelistCRIT[t]
AP = singleGamelistAP[t]
ARM = singleGamelistARM[t] + singleGamelistHP[t]
MR = singleGamelistMR[t] + singleGamelistHP[t]
#creates the hash for that "situation"
hashsit = hash(AD, AP, ARM, MR, champid)
#build object, which has build and situation in it as well as winrate
build = SituationalBuild.SituationalBuild(hashsit, finalbuildorder(match, j))
buildlist.append(build)
if match["participants"][j]["stats"]["winner"] == True:
build.addWin()
else:
build.addloss()
#list now is sorted by situation and by winrate
'''
for i in range (len(buildlist)):
print(buildlist[i].getbuildseq() + " " + str(buildlist[i].getwinrate()) + " " + str(buildlist[i].getsituation()))
'''
#processes the builds
situationbuild = situationalbuildlist(buildlist)
for k in range (len(situationbuild)):
sorted(situationbuild[k], key = getKey)
condensebuilds(situationbuild)
#database stuff
conn = sqlite3.connect('main.db')
conn.execute('''CREATE TABLE DATA2
(Hash INT
r0 TEXT,
r1 TEXT,
r2 TEXT,
r3 TEXT,
r4 TEXT,
r5 TEXT,
r6 TEXT,
r7 TEXT,
r8 TEXT,
r9 TEXT,
r10 TEXT,
r11 TEXT,
r12 TEXT,
r13 TEXT,
r14 TEXT,
r15 TEXT,
r16 TEXT,
r17 TEXT,
r18 TEXT,
r19 TEXT,
r20 TEXT,
r21 TEXT,
r22 TEXT,
r23 TEXT,
r24 TEXT,
r25 TEXT,
r26 TEXT,
r27 TEXT,
r28 TEXT,
r29 TEXT,
r30 TEXT,
r31 TEXT,
r32 TEXT,
r33 TEXT,
r34 TEXT,
r35 TEXT,
#.........这里部分代码省略.........