Exemplo n.º 1
0
def mapDataToKey(itemBuy):
    return KeyTuple(
        getRegionEnum(itemBuy.region), getVersionEnum(itemBuy.patch),
        mappingsForMap[itemBuy.mapId], itemBuy.queueType,
        itemBuy.participantElo, itemBuy.champion, itemBuy.itemId,
        RoleTypes.ANY, LaneTypes.ANY
    )  #Can't really handle that much information without a database, so we leave it out atm
Exemplo n.º 2
0
 def __init__(self, patchString):
     self._items = defaultdict(int)
     self.version = getVersionEnum(patchString)
Exemplo n.º 3
0
 def __init__(self, patchString):
     self._items = defaultdict(int)
     self.version = getVersionEnum(patchString)
Exemplo n.º 4
0
Created on 25.08.2015

@author: Katora
'''
from . import relevantVersions
from riotapi import getDownloader
from lolstatic import getVersionEnum, Versions
from collections import defaultdict

'''Holds the items for each patch. Version ANY contains the newest available data for each id
'''
versionToItems = defaultdict(dict) 

for patch in relevantVersions:
    dl = getDownloader()
    itemsAnswer = dl.api_request("/api/lol/static-data/euw/v1.2/item", itemListData = 'all', version = patch)
    itemsVersion = itemsAnswer['version']
    version = getVersionEnum(itemsVersion)
    nameToItem = itemsAnswer['data']
    versionToItems[version] = {nameToItem[name]['id']: nameToItem[name] for name in nameToItem}
    versionToItems[Versions.ANY].update(versionToItems[version])
    print("Gathered items for version ", version)

apItemIds = defaultdict(list)   #Maps item ids that are ap items to a list of patches in which they are
for version in Versions:
    itemsOfVersion = versionToItems[version]
    for itemId in itemsOfVersion:
        item = itemsOfVersion[itemId]
        if 'PercentMagicDamageMod' in item['stats'] or 'FlatMagicDamageMod' in item['stats']:
            apItemIds[itemId].append(version)
Exemplo n.º 5
0
'''
from . import relevantVersions
from riotapi import getDownloader
from lolstatic import getVersionEnum, Versions
from collections import defaultdict
'''Holds the items for each patch. Version ANY contains the newest available data for each id
'''
versionToItems = defaultdict(dict)

for patch in relevantVersions:
    dl = getDownloader()
    itemsAnswer = dl.api_request("/api/lol/static-data/euw/v1.2/item",
                                 itemListData='all',
                                 version=patch)
    itemsVersion = itemsAnswer['version']
    version = getVersionEnum(itemsVersion)
    nameToItem = itemsAnswer['data']
    versionToItems[version] = {
        nameToItem[name]['id']: nameToItem[name]
        for name in nameToItem
    }
    versionToItems[Versions.ANY].update(versionToItems[version])
    print("Gathered items for version ", version)

apItemIds = defaultdict(
    list
)  #Maps item ids that are ap items to a list of patches in which they are
for version in Versions:
    itemsOfVersion = versionToItems[version]
    for itemId in itemsOfVersion:
        item = itemsOfVersion[itemId]