from py_lol.riot_api import RiotAPI




class Match:
    class _Participant:
        def __init__(self, data):
            self.allInPings:int = data['allInPings']
            self.assistMePings:int = data['assistMePings']
            self.assists:int = data['assists']
            self.baronKills:int = data['baronKills']
            self.basicPings:int = data['basicPings']
            self.bountyLevel:int = data['bountyLevel']
            self.champExperience:int = data['champExperience']
            self.champLevel:int = data['champLevel']
            self.championId:int = data['championId']
            self.championName:str = data['championName']
            self.championTransform:int = data['championTransform']
            self.commandPings:int = data['commandPings']
            self.consumablesPurchased:int = data['consumablesPurchased']
            self.damageDealtToBuildings:int = data['damageDealtToBuildings']
            self.damageDealtToObjectives:int = data['damageDealtToObjectives']
            self.damageDealtToTurrets:int = data['damageDealtToTurrets']
            self.damageSelfMitigated:int = data['damageSelfMitigated']
            self.dangerPings:int = data['dangerPings']
            self.deaths:int = data['deaths']
            self.detectorWardsPlaced:int = data['detectorWardsPlaced']
            self.doubleKills:int = data['doubleKills']
            self.dragonKills:int = data['dragonKills']
            self.eligibleForProgression:bool = data['eligibleForProgression']
            self.enemyMissingPings:int = data['enemyMissingPings']
            self.enemyVisionPings:int = data['enemyVisionPings']
            self.firstBloodAssist:bool = data['firstBloodAssist']
            self.firstBloodKill:bool = data['firstBloodKill']
            self.firstTowerAssist:bool = data['firstTowerAssist']
            self.firstTowerKill:bool = data['firstTowerKill']
            self.gameEndedInEarlySurrender:bool = data['gameEndedInEarlySurrender']
            self.gameEndedInSurrender:bool = data['gameEndedInSurrender']
            self.getBackPings:int = data['getBackPings']
            self.doubleKills:int = data['doubleKills']
            self.goldEarned:int = data['goldEarned']
            self.goldSpent:int = data['goldSpent']
            self.holdPings: int = data['holdPings']
            self.individualPosition: str = data['individualPosition']
            self.inhibitorKills: int = data['inhibitorKills']
            self.inhibitorTakedowns: int = data['inhibitorTakedowns']
            self.inhibitorsLost: int = data['inhibitorsLost']
            self.item0: int = data['item0']
            self.item1: int = data['item1']
            self.item2: int = data['item2']
            self.item3: int = data['item3']
            self.item4: int = data['item4']
            self.item5: int = data['item5']
            self.item6: int = data['item6']
            self.itemsPurchased: int = data['itemsPurchased']
            self.killingSprees: int = data['killingSprees']
            self.kills: int = data['kills']
            self.lane: str = data['lane']
            self.largestCriticalStrike: int = data['largestCriticalStrike']
            self.largestKillingSpree: int = data['largestKillingSpree']
            self.largestMultiKill: int = data['largestMultiKill']
            self.longestTimeSpentLiving: int = data['longestTimeSpentLiving']
            self.magicDamageDealt: int = data['magicDamageDealt']
            self.magicDamageDealtToChampions: int = data['magicDamageDealtToChampions']
            self.magicDamageTaken: int = data['magicDamageTaken']
            self.needVisionPings: int = data['needVisionPings']
            self.neutralMinionsKilled: int = data['neutralMinionsKilled']
            self.nexusKills: int = data['nexusKills']
            self.nexusLost: int = data['nexusLost']
            self.nexusTakedowns: int = data['nexusTakedowns']
            self.objectivesStolen: int = data['objectivesStolen']
            self.objectivesStolenAssists: int = data['objectivesStolenAssists']
            self.onMyWayPings: int = data['onMyWayPings']
            self.pentaKills: int = data['pentaKills']
            self.physicalDamageDealt: int = data['physicalDamageDealt']
            self.physicalDamageDealtToChampions: int = data['physicalDamageDealtToChampions']
            self.physicalDamageTaken: int = data['physicalDamageTaken']
            self.placement: int = data['placement']
            self.playerAugment1: int = data['playerAugment1']
            self.playerAugment2: int = data['playerAugment2']
            self.playerAugment3: int = data['playerAugment3']
            self.playerAugment4: int = data['playerAugment4']
            self.playerAugment5: int = data['playerAugment5']
            self.playerAugment6: int = data['playerAugment6']
            self.playerSubteamId: int = data['playerSubteamId']
            self.profileIcon: int = data['profileIcon']
            self.pushPings: int = data['pushPings']
            self.puuid: str = data['puuid']
            self.quadraKills: int = data['quadraKills']
            self.riotIdGameName: str = data['riotIdGameName']
            self.riotIdTagline: str = data['riotIdTagline']
            self.role: str = data['role']
            self.sightWardsBoughtInGame: int = data['sightWardsBoughtInGame']
            self.spell1Casts: int = data['spell1Casts']
            self.spell2Casts: int = data['spell2Casts']
            self.spell3Casts: int = data['spell3Casts']
            self.spell4Casts: int = data['spell4Casts']
            self.subteamPlacement: int = data['subteamPlacement']
            self.summoner1Casts: int = data['summoner1Casts']
            self.summoner1Id: int = data['summoner1Id']
            self.summoner2Casts: int = data['summoner2Casts']
            self.summoner2Id : int = data['summoner2Id']
            self.summonerId: str = data['summonerId']
            self.summonerLevel: int = data['summonerLevel']
            self.summonerName: str = data['summonerName']
            self.teamEarlySurrendered: bool = data['teamEarlySurrendered']
            self.teamId: int = data['teamId']
            self.teamPosition: str = data['teamPosition']
            self.timeCCingOthers: int = data['timeCCingOthers']
            self.timePlayed: int = data['timePlayed']
            self.totalAllyJungleMinionsKilled: int = data['totalAllyJungleMinionsKilled']
            self.totalDamageDealt: int = data['totalDamageDealt']
            self.totalDamageDealtToChampions: int = data['totalDamageDealtToChampions']
            self.totalDamageShieldedOnTeammates: int = data['totalDamageShieldedOnTeammates']
            self.totalDamageTaken: int = data['totalDamageTaken']
            self.totalEnemyJungleMinionsKilled: int = data['totalEnemyJungleMinionsKilled']
            self.totalHeal: int = data['totalHeal']
            self.totalHealsOnTeammates: int = data['totalHealsOnTeammates']
            self.totalMinionsKilled: int = data['totalMinionsKilled']
            self.totalTimeCCDealt: int = data['totalTimeCCDealt']
            self.totalTimeSpentDead: int = data['totalTimeSpentDead']
            self.totalUnitsHealed: int = data['totalUnitsHealed']
            self.tripleKills: int = data['tripleKills']
            self.trueDamageDealt: int = data['trueDamageDealt']
            self.trueDamageDealtToChampions: int = data['trueDamageDealtToChampions']
            self.trueDamageTaken: int = data['trueDamageTaken']
            self.turretKills: int = data['turretKills']
            self.turretTakedowns: int = data['turretTakedowns']
            self.turretsLost: int = data['turretsLost']
            self.unrealKills: int = data['unrealKills']
            self.visionClearedPings: int = data['visionClearedPings']
            self.visionScore: int = data['visionScore']
            self.visionWardsBoughtInGame: int = data['visionWardsBoughtInGame']
            self.wardsKilled: int = data['wardsKilled']
            self.wardsPlaced: int = data['wardsPlaced']
            self.win: bool = data['win']

    def __init__(self, api, data):
        self.api:RiotAPI = api
        self.matchId:str = data['metadata']['matchId']
        data = data['info']
        self.gameCreation:int = data['gameCreation']
        self.gameDuration:int = data['gameDuration']
        self.gameEndTimestamp:int = data['gameEndTimestamp']
        self.gameStartTimestamp:int = data['gameStartTimestamp']
        self.gameMode:str = data['gameMode']
        self.mapId:int = data['mapId']
        self.queueId:int = data['queueId']
        self.participants:list[Match._Participant] = [Match._Participant(participant) for participant in data['participants']]


