當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。