# Path: steamapi/getheroes.py
# def requestGetHeroes():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: steamapi/getproplayerlist.py
# def requestGetProPlayerList():
#     URL = "https://api.steampowered.com/IDOTA2Fantasy_570/GetProPlayerList/v1?key=" + SteamAPIKey
# 
# Path: misc/idnamedict.py
# def gameMode(gameModeID):
#     return {
#         -1: 'skipped',
#         0 : 'Unknown',
#         1 : 'All Pick',
#         2 : 'Captains Mode',
#         3 : 'Random Draft',
#         4 : 'Single Draft',
#         5 : 'All Random',
#         6 : '?? INTRO/DEATH ??',
#         7 : 'The Diretide',
#         8 : 'Reverse Captains Mode',
#         9 : 'Greeviling',
#         10 : 'Tutorial',
#         11 : 'Mid Only',
#         12 : 'Least Played',
#         13 : 'New Player Pool',
#         14 : 'Compendium Matchmaking',
#         15 : 'Custom',
#         16 : 'Captains Draft',
#         17 : 'Balanced Draft',
#         18 : 'Ability Draft',
#         19 : '?? Event ??',
#         20 : 'All Random Death Match',
#         21 : '1vs1 Solo Mid',
#         22 : 'Ranked All Pick',
#     }.get(gameModeID, 'Unkown')
# 
# Path: converter/playerconverter.py
# def playerConverter(playerID, playerSummariesJson=None, includeMMR=False):
# def getMMR(playerID):
#     MMR = None
#         MMR = getMMR(playerID)
#         MMR = {}


from steamapi.getheroes import heroDictionary
from steamapi.getproplayerlist import proPlayerDictionary
from misc.idnamedict import gameMode
from converter import playerconverter
        if (i == 8):
            break
    resultHeroes = resultHeroes + '\n'

    return resultHeroes

def displayResult(playerID, analysis, detailedAnalysis, detailedMatches, getMMR=True):
    youDescription = playerconverter.playerConverter(playerID)
    MMR = None
    if getMMR:
        MMR = playerconverter.getMMR(playerID)

    matchesPlayed = len(detailedMatches) - len(analysis['general']['skipped'])

    durationM, durationS = divmod((analysis['general']['duration'])/matchesPlayed, 60)
    fbM, fbS = divmod((analysis['general']['first_blood_time'])/matchesPlayed, 60)
    towersDestroyed = (analysis['enemyTeam']['tier1'] + analysis['enemyTeam']['tier2'] + analysis['enemyTeam']['tier3'] + analysis['enemyTeam']['tier4'] \
                    + analysis['allyTeam']['tier1']  + analysis['allyTeam']['tier2']  + analysis['allyTeam']['tier3']  + analysis['allyTeam']['tier4'])/matchesPlayed
    barracksDestroyed = (analysis['enemyTeam']['meleeBarracks'] + analysis['enemyTeam']['rangeBarracks'] \
                         + analysis['allyTeam']['meleeBarracks'] +analysis['allyTeam']['rangeBarracks'])/matchesPlayed

    numbers = (durationM,durationS,fbM,fbS,round(towersDestroyed,2),round(barracksDestroyed,2))

    averageInformation = 'Average match duration: %02d:%02d, average first blood time: %02d:%02d, average towers destroyed: %s, average barracks destroyed: %s' %numbers



    playedModes = {}
    for i in range(0, 23):
    #for i in range(-1, 23):

# Path: steamapi/getheroes.py
# def requestGetHeroes():
#     URL = "https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=" + SteamAPIKey + "&language=en_us"
# 
# Path: steamapi/getproplayerlist.py
# def requestGetProPlayerList():
#     URL = "https://api.steampowered.com/IDOTA2Fantasy_570/GetProPlayerList/v1?key=" + SteamAPIKey
# 
# Path: misc/idnamedict.py
# def gameMode(gameModeID):
#     return {
#         -1: 'skipped',
#         0 : 'Unknown',
#         1 : 'All Pick',
#         2 : 'Captains Mode',
#         3 : 'Random Draft',
#         4 : 'Single Draft',
#         5 : 'All Random',
#         6 : '?? INTRO/DEATH ??',
#         7 : 'The Diretide',
#         8 : 'Reverse Captains Mode',
#         9 : 'Greeviling',
#         10 : 'Tutorial',
#         11 : 'Mid Only',
#         12 : 'Least Played',
#         13 : 'New Player Pool',
#         14 : 'Compendium Matchmaking',
#         15 : 'Custom',
#         16 : 'Captains Draft',
#         17 : 'Balanced Draft',
#         18 : 'Ability Draft',
#         19 : '?? Event ??',
#         20 : 'All Random Death Match',
#         21 : '1vs1 Solo Mid',
#         22 : 'Ranked All Pick',
#     }.get(gameModeID, 'Unkown')
# 
# Path: converter/playerconverter.py
# def playerConverter(playerID, playerSummariesJson=None, includeMMR=False):
# def getMMR(playerID):
#     MMR = None
#         MMR = getMMR(playerID)
#         MMR = {}


# Path: displayreddit/draveragelastxgames.py
from steamapi.getheroes import heroDictionary
from steamapi.getproplayerlist import proPlayerDictionary
from misc.idnamedict import gameMode
from converter import playerconverter

        if (i == 8):
            break
    resultHeroes = resultHeroes + '\n'

    return resultHeroes

def displayResult(playerID, analysis, detailedAnalysis, detailedMatches, getMMR=True):
    youDescription = playerconverter.playerConverter(playerID)
    MMR = None
    if getMMR:
        MMR = playerconverter.getMMR(playerID)

    matchesPlayed = len(detailedMatches) - len(analysis['general']['skipped'])

    durationM, durationS = divmod((analysis['general']['duration'])/matchesPlayed, 60)
    fbM, fbS = divmod((analysis['general']['first_blood_time'])/matchesPlayed, 60)
    towersDestroyed = (analysis['enemyTeam']['tier1'] + analysis['enemyTeam']['tier2'] + analysis['enemyTeam']['tier3'] + analysis['enemyTeam']['tier4'] \
                    + analysis['allyTeam']['tier1']  + analysis['allyTeam']['tier2']  + analysis['allyTeam']['tier3']  + analysis['allyTeam']['tier4'])/matchesPlayed
    barracksDestroyed = (analysis['enemyTeam']['meleeBarracks'] + analysis['enemyTeam']['rangeBarracks'] \
                         + analysis['allyTeam']['meleeBarracks'] +analysis['allyTeam']['rangeBarracks'])/matchesPlayed

    numbers = (durationM,durationS,fbM,fbS,round(towersDestroyed,2),round(barracksDestroyed,2))

    averageInformation = 'Average match duration: %02d:%02d, average first blood time: %02d:%02d, average towers destroyed: %s, average barracks destroyed: %s' %numbers



    playedModes = {}
    for i in range(0, 23):
    #for i in range(-1, 23):

        if (len(analysis['general'][gameMode(i)]) != 0):