added roundstats with eco info, switched to avatar hash

This commit is contained in:
2021-10-17 03:52:20 +02:00
parent 7f5a2f8956
commit fd8c026a8e
35 changed files with 4187 additions and 160 deletions

View File

@@ -108,9 +108,11 @@ type StatsEdges struct {
Players *Player `json:"players,omitempty"`
// WeaponStats holds the value of the weapon_stats edge.
WeaponStats []*WeaponStats `json:"weapon_stats,omitempty"`
// RoundStats holds the value of the round_stats edge.
RoundStats []*RoundStats `json:"round_stats,omitempty"`
// loadedTypes holds the information for reporting if a
// type was loaded (or requested) in eager-loading or not.
loadedTypes [3]bool
loadedTypes [4]bool
}
// MatchesOrErr returns the Matches value or an error if the edge
@@ -150,6 +152,15 @@ func (e StatsEdges) WeaponStatsOrErr() ([]*WeaponStats, error) {
return nil, &NotLoadedError{edge: "weapon_stats"}
}
// RoundStatsOrErr returns the RoundStats value or an error if the edge
// was not loaded in eager-loading.
func (e StatsEdges) RoundStatsOrErr() ([]*RoundStats, error) {
if e.loadedTypes[3] {
return e.RoundStats, nil
}
return nil, &NotLoadedError{edge: "round_stats"}
}
// scanValues returns the types for scanning values from sql.Rows.
func (*Stats) scanValues(columns []string) ([]interface{}, error) {
values := make([]interface{}, len(columns))
@@ -436,6 +447,11 @@ func (s *Stats) QueryWeaponStats() *WeaponStatsQuery {
return (&StatsClient{config: s.config}).QueryWeaponStats(s)
}
// QueryRoundStats queries the "round_stats" edge of the Stats entity.
func (s *Stats) QueryRoundStats() *RoundStatsQuery {
return (&StatsClient{config: s.config}).QueryRoundStats(s)
}
// Update returns a builder for updating this Stats.
// Note that you need to call Stats.Unwrap() before calling this method if this Stats
// was returned from a transaction, and the transaction was committed or rolled back.