diff --git a/structs/champion.go b/structs/champion.go new file mode 100644 index 0000000..15c2954 --- /dev/null +++ b/structs/champion.go @@ -0,0 +1,10 @@ +package structs + +type Champion struct { + Name string `json:"name"` + ExternalId int64 `json:"external_id"` + Images struct { + Default string `json:"default"` + Thumbnail string `json:"thumbnail"` + } `json:"images"` +} diff --git a/structs/match_summary.go b/structs/match_summary.go index 337bcf7..15e4b25 100644 --- a/structs/match_summary.go +++ b/structs/match_summary.go @@ -247,32 +247,26 @@ type LolMatchSummary struct { RiftHeralds []LolEvent `json:"rift_heralds"` } `json:"objective_events"` Draft []struct { - RosterId int64 `json:"roster_id"` - Champion struct { - Name string `json:"name"` - ExternalId int64 `json:"external_id"` - } `json:"champion"` - Order *int64 `json:"order"` - Type string `json:"type"` + RosterId int64 `json:"roster_id"` + Champion Champion `json:"champion"` + Order *int64 `json:"order"` + Type string `json:"type"` } `json:"draft"` } type LolPlayer struct { - PlayerId int64 `json:"player_id"` - Role string `json:"role"` - Lane string `json:"lane"` - Kills int64 `json:"kills"` - Deaths int64 `json:"deaths"` - Assists int64 `json:"assists"` - GoldEarned int64 `json:"gold_earned"` - GoldSpent int64 `json:"gold_spent"` - Gpm float64 `json:"gpm"` - TotalXp int64 `json:"total_xp"` - Xpm float64 `json:"xpm"` - Champion struct { - Name string `json:"name"` - ExternalId int64 `json:"external_id"` - } `json:"champion"` + PlayerId int64 `json:"player_id"` + Role string `json:"role"` + Lane string `json:"lane"` + Kills int64 `json:"kills"` + Deaths int64 `json:"deaths"` + Assists int64 `json:"assists"` + GoldEarned int64 `json:"gold_earned"` + GoldSpent int64 `json:"gold_spent"` + Gpm float64 `json:"gpm"` + TotalXp int64 `json:"total_xp"` + Xpm float64 `json:"xpm"` + Champion Champion `json:"champion"` KillCombos struct { Double int64 `json:"double"` Triple int64 `json:"triple"` diff --git a/structs/player_stats.go b/structs/player_stats.go index 8a67604..8262bd6 100644 --- a/structs/player_stats.go +++ b/structs/player_stats.go @@ -219,16 +219,14 @@ type LolPlayerStats struct { KillingSprees int64 `json:"killing_sprees"` } `json:"largest_combos"` MostPlayedChampion []struct { - Champion struct { - Name string `json:"name"` - } `json:"champion"` - NrMatches int64 `json:"nr_matches"` - NrWins int64 `json:"nr_wins"` - AvgKills float64 `json:"avg_kills"` - AvgDeaths float64 `json:"avg_deaths"` - AvgAssists float64 `json:"avg_assists"` - AvgGpm float64 `json:"avg_gpm"` - AvgXpm float64 `json:"avg_xpm"` + Champion Champion `json:"champion"` + NrMatches int64 `json:"nr_matches"` + NrWins int64 `json:"nr_wins"` + AvgKills float64 `json:"avg_kills"` + AvgDeaths float64 `json:"avg_deaths"` + AvgAssists float64 `json:"avg_assists"` + AvgGpm float64 `json:"avg_gpm"` + AvgXpm float64 `json:"avg_xpm"` } `json:"most_played_champions"` SideStats struct { Purple struct { diff --git a/structs/team_stats.go b/structs/team_stats.go index caee3cc..f4c6925 100644 --- a/structs/team_stats.go +++ b/structs/team_stats.go @@ -269,11 +269,9 @@ type LolTeamStats struct { } `json:"blue"` } `json:"side_stats"` Champions []struct { - NrMatches int64 `json:"nr_matches"` - NrWins int64 `json:"nr_wins"` - Champion struct { - Name string `json:"name"` - } `json:"champion"` + NrMatches int64 `json:"nr_matches"` + NrWins int64 `json:"nr_wins"` + Champion Champion `json:"champion"` } `json:"champions"` TopStats struct { Kills LolPlayerAgainst `json:"kills"` @@ -331,13 +329,11 @@ type LolTeamAgainst struct { } type LolPlayerAgainst struct { - Value float64 `json:"value"` - PlayerId int64 `json:"player_id"` - MatchId int64 `json:"match_id"` - Champion struct { - Name string `json:"name"` - } `json:"champion"` - Against Roster `json:"against"` + Value float64 `json:"value"` + PlayerId int64 `json:"player_id"` + MatchId int64 `json:"match_id"` + Champion Champion `json:"champion"` + Against Roster `json:"against"` } // PlayerAgainst is a collection of common data when examining specific stats.