-
Notifications
You must be signed in to change notification settings - Fork 0
/
common_structs.go
243 lines (230 loc) · 9.16 KB
/
common_structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
package pubg
type links struct {
// Link to this object
Self string `json:"self"`
}
type dataIDAndType struct {
Data struct {
Type string `json:"type"`
ID string `json:"id"`
} `json:"data"`
}
type dataArrayIDAndType struct {
Data []struct {
Type string `json:"type"`
ID string `json:"id"`
} `json:"data"`
}
type statistics struct {
Type string `json:"type"`
Attributes struct {
GameModeStats map[string]gameModeStats `json:"gameModeStats"`
BestRankPoint float64 `json:"bestRankPoint"`
} `json:"attributes"`
Relationships struct {
// type - Identifier for this object type ("player")
// id - Player ID
Player dataIDAndType `json:"player"`
// type - Identifier for this object type ("season")
// id - Season ID. Used to lookup a player's stats for this season on the /players endpoint
Season dataIDAndType `json:"season"`
// Contains a list of match IDs.
// Array:
// type - Identifier for this object type ("match")
// id - Match ID. Used to lookup the full match object on the /matches endpoint
MatchesSolo dataArrayIDAndType `json:"matchesSolo"`
MatchesSoloFPP dataArrayIDAndType `json:"matchesSoloFPP"`
MatchesDuo dataArrayIDAndType `json:"matchesDuo"`
MatchesDuoFPP dataArrayIDAndType `json:"matchesDuoFPP"`
MatchesSquad dataArrayIDAndType `json:"matchesSquad"`
MatchesSquadFPP dataArrayIDAndType `json:"matchesSquadFPP"`
} `json:"relationships"`
}
type gameModeStats struct {
// Number of enemy players this player damaged that were killed by teammates
Assists int `json:"assists"`
// Number of boost items used
Boosts int `json:"boosts"`
// Number of enemy players knocked
DBNOs int `json:"dBNOs"`
// Number of kills during the most recent day played.
DailyKills int `json:"dailyKills"`
// Total damage dealt. Note: Self inflicted damage is subtracted
DamageDealt float64 `json:"damageDealt"`
// Days :)
Days int `json:"days"`
// Number of wins during the most recent day played.
DailyWins int `json:"dailyWins"`
// Number of enemy players killed with headshots
HeadshotKills int `json:"headshotKills"`
// Number of healing items used
Heals int `json:"heals"`
// Number of enemy players killed
Kills int `json:"kills"`
// Longest kill
LongestKill float64 `json:"longestKill"`
// Longest time survived in a match
LongestTimeSurvived float64 `json:"longestTimeSurvived"`
// Number of matches lost
Losses int `json:"losses"`
// Maximum kill streaks
MaxKillStreaks int `json:"maxKillStreaks"`
// Longest time survived in a match
MostSurvivalTime float64 `json:"mostSurvivalTime"`
// Number of times this player revived teammates
Revives int `json:"revives"`
// Total distance traveled in vehicles measured in meters
RideDistance float64 `json:"rideDistance"`
// Number of kills while in a vehicle
RoadKills int `json:"roadKills"`
// Highest number of kills in a single match
RoundMostKills int `json:"roundMostKills"`
// Number of matches played
RoundsPlayed int `json:"roundsPlayed"`
// Number of self-inflicted deaths
Suicides int `json:"suicides"`
// Total distance traveled while swimming measured in meters
SwimDistance float64 `json:"swimDistance"`
// Number of times this player killed a teammate
TeamKills int `json:"teamKills"`
// Total time survived
TimeSurvived float64 `json:"timeSurvived"`
// Number of times this player made it to the top 10 in a match
Top10s int `json:"top10s"`
// Number of vehicles destroyed
VehicleDestroys int `json:"vehicleDestroys"`
// Total distance traveled on foot measured in meters
WalkDistance float64 `json:"walkDistance"`
// Number of weapons picked up
WeaponsAcquired int `json:"weaponsAcquired"`
// Number of kills during the most recent week played
WeeklyKills int `json:"weeklyKills"`
// Number of wins during the most recent week played.
WeeklyWins int `json:"weeklyWins"`
// Number of matches won
Wins int `json:"wins"`
}
// The weapon summary for each weapon
type weaponSummary struct {
// The total amount of XP earned for this weapon
XPTotal int `json:"XPTotal"`
// The current level of this weapon
LevelCurrent int `json:"LevelCurrent"`
// The current tier of this weapon
TierCurrent int `json:"TierCurrent"`
// The weapon mastery stats for this weapon
StatsTotal struct {
// Most defeats in a single match
MostDefeatsInAGame int `json:"MostDefeatsInAGame"`
// The total number of defeats in their career
Defeats int `json:"Defeats"`
// The most damage that the player did in a single match
MostDamagePlayerInAGame float64 `json:"MostDamagePlayerInAGame"`
// The total damage that the player has done in their career
DamagePlayer float64 `json:"DamagePlayer"`
// The most headshots that the player did in a single match
MostHeadShotsInAGame int `json:"MostHeadShotsInAGame"`
// The total headshots that the player has done in their career
HeadShots int `json:"HeadShots"`
// The longest distance that the player got a defeat for
LongestDefeat float64 `json:"LongestDefeat"`
// The number of long range defeats for the player
LongRangeDefeats int `json:"LongRangeDefeats"`
// The total number of kills for the player
Kills int `json:"Kills"`
// The most kills for a player in a single match
MostKillsInAGame int `json:"MostKillsInAGame"`
// The total number of times that the player has caused another player to become groggy during their career
Groggies int `json:"Groggies"`
// The highest number of times that the player has caused another player to become groggy during a match
MostGroggiesInAGame int `json:"MostGroggiesInAGame"`
} `json:"StatsTotal"`
// The weapon mastery stats for this weapon for games played in Official mode only
OfficialStatsTotal struct {
// Most defeats in a single match
MostDefeatsInAGame int `json:"MostDefeatsInAGame"`
// The total number of defeats in their career
Defeats int `json:"Defeats"`
// The total damage that the player has done in their career
DamagePlayer int `json:"DamagePlayer"`
// The total headshots that the player has done in their career
HeadShots int `json:"HeadShots"`
// The total number of kills for the player
Kills int `json:"Kills"`
// The most kills for a player in a single match
MostKillsInAGame int `json:"MostKillsInAGame"`
// The total number of times that the player has caused another player to become groggy during their career
Groggies int `json:"Groggies"`
// The longest distance that the player got a kill for
LongestKill int `json:"LongestKill"`
} `json:"OfficialStatsTotal"`
CompetitiveStatsTotal struct {
// Most defeats in a single match
MostDefeatsInAGame int `json:"MostDefeatsInAGame"`
// The total number of defeats in their career
Defeats int `json:"Defeats"`
// The total damage that the player has done in their career
DamagePlayer int `json:"DamagePlayer"`
// The total headshots that the player has done in their career
HeadShots int `json:"HeadShots"`
// The total number of kills for the player
Kills int `json:"Kills"`
// The most kills for a player in a single match
MostKillsInAGame int `json:"MostKillsInAGame"`
// The total number of times that the player has caused another player to become groggy during their career
Groggies int `json:"Groggies"`
// The longest distance that the player got a kill for
LongestKill int `json:"LongestKill"`
} `json:"CompetitiveStatsTotal"`
}
type rankedStatistics struct {
Type string `json:"type"`
Attributes struct {
RankedGameModeStats map[string]rankedGameModeStats `json:"rankedGameModeStats"`
} `json:"attributes"`
Relationships struct {
// type - Identifier for this object type ("player")
// id - Player ID
Player dataIDAndType `json:"player"`
// type - Identifier for this object type ("season")
// id - Season ID. Used to lookup a player's stats for this season on the /players endpoint
Season dataIDAndType `json:"season"`
} `json:"relationships"`
}
// rankedGameModeStats structure contain a player's aggregated ranked stats for a game mode in the context of a season.
type rankedGameModeStats struct {
// Player's current rank points
CurrentRankPoint int `json:"currentRankPoint"`
// Player's highest rank points
BestRankPoint int `json:"bestRankPoint"`
CurrentTier Tier `json:"currentTier"`
BestTier Tier `json:"bestTier"`
// Number of matches played
RoundsPlayed int `json:"roundsPlayed"`
// Average rank
AvgRank float64 `json:"avgRank"`
// Ratio of number of times this player made it to the top 10 in a match / times didn't make it to top 10
Top10Ratio float64 `json:"top10Ratio"`
// Ratio of number of matches won / matches didn't win
WinRatio float64 `json:"winRatio"`
// Number of enemy players this player damaged that were killed by teammates
Assists int `json:"assists"`
// Number of matches won
Wins int `json:"wins"`
// Kill death assist ratio
Kda float64 `json:"kda"`
// Number of enemy players killed
Kills int `json:"kills"`
// Number of player deaths
Deaths int `json:"deaths"`
// Total damage dealt. Note: Self inflicted damage is subtracted
DamageDealt float64 `json:"damageDealt"`
// Number of enemy players knocked
DBNOs int `json:"dBNOs"`
}
type Tier struct {
// Player's current ranked tier
Tier string `json:"tier"`
// Player's current ranked subtier
SubTier string `json:"subTier"`
}