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


Python StatValues.requestSeedData方法代码示例

本文整理汇总了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,
#.........这里部分代码省略.........
开发者ID:Maxxor1997,项目名称:freelo-builds,代码行数:103,代码来源:BuildPathGen.py


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