Skip to content

Commit

Permalink
Merge pull request #8 from AbiosGaming/f/lol-champion
Browse files Browse the repository at this point in the history
Add League of Legens Champion struct
  • Loading branch information
patstrom authored Mar 25, 2019
2 parents 60493df + f7e3e62 commit f9071fa
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
10 changes: 10 additions & 0 deletions structs/champion.go
Original file line number Diff line number Diff line change
@@ -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"`
}
38 changes: 16 additions & 22 deletions structs/match_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
18 changes: 8 additions & 10 deletions structs/player_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 8 additions & 12 deletions structs/team_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit f9071fa

Please sign in to comment.