3345 lines
89 KiB
Go
3345 lines
89 KiB
Go
// Code generated by entc, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"context"
|
|
"csgowtfd/ent/match"
|
|
"csgowtfd/ent/player"
|
|
"csgowtfd/ent/predicate"
|
|
"csgowtfd/ent/roundstats"
|
|
"csgowtfd/ent/stats"
|
|
"csgowtfd/ent/weaponstats"
|
|
"fmt"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// StatsUpdate is the builder for updating Stats entities.
|
|
type StatsUpdate struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *StatsMutation
|
|
}
|
|
|
|
// Where appends a list predicates to the StatsUpdate builder.
|
|
func (su *StatsUpdate) Where(ps ...predicate.Stats) *StatsUpdate {
|
|
su.mutation.Where(ps...)
|
|
return su
|
|
}
|
|
|
|
// SetTeamID sets the "team_id" field.
|
|
func (su *StatsUpdate) SetTeamID(i int) *StatsUpdate {
|
|
su.mutation.ResetTeamID()
|
|
su.mutation.SetTeamID(i)
|
|
return su
|
|
}
|
|
|
|
// AddTeamID adds i to the "team_id" field.
|
|
func (su *StatsUpdate) AddTeamID(i int) *StatsUpdate {
|
|
su.mutation.AddTeamID(i)
|
|
return su
|
|
}
|
|
|
|
// SetKills sets the "kills" field.
|
|
func (su *StatsUpdate) SetKills(i int) *StatsUpdate {
|
|
su.mutation.ResetKills()
|
|
su.mutation.SetKills(i)
|
|
return su
|
|
}
|
|
|
|
// AddKills adds i to the "kills" field.
|
|
func (su *StatsUpdate) AddKills(i int) *StatsUpdate {
|
|
su.mutation.AddKills(i)
|
|
return su
|
|
}
|
|
|
|
// SetDeaths sets the "deaths" field.
|
|
func (su *StatsUpdate) SetDeaths(i int) *StatsUpdate {
|
|
su.mutation.ResetDeaths()
|
|
su.mutation.SetDeaths(i)
|
|
return su
|
|
}
|
|
|
|
// AddDeaths adds i to the "deaths" field.
|
|
func (su *StatsUpdate) AddDeaths(i int) *StatsUpdate {
|
|
su.mutation.AddDeaths(i)
|
|
return su
|
|
}
|
|
|
|
// SetAssists sets the "assists" field.
|
|
func (su *StatsUpdate) SetAssists(i int) *StatsUpdate {
|
|
su.mutation.ResetAssists()
|
|
su.mutation.SetAssists(i)
|
|
return su
|
|
}
|
|
|
|
// AddAssists adds i to the "assists" field.
|
|
func (su *StatsUpdate) AddAssists(i int) *StatsUpdate {
|
|
su.mutation.AddAssists(i)
|
|
return su
|
|
}
|
|
|
|
// SetHeadshot sets the "headshot" field.
|
|
func (su *StatsUpdate) SetHeadshot(i int) *StatsUpdate {
|
|
su.mutation.ResetHeadshot()
|
|
su.mutation.SetHeadshot(i)
|
|
return su
|
|
}
|
|
|
|
// AddHeadshot adds i to the "headshot" field.
|
|
func (su *StatsUpdate) AddHeadshot(i int) *StatsUpdate {
|
|
su.mutation.AddHeadshot(i)
|
|
return su
|
|
}
|
|
|
|
// SetMvp sets the "mvp" field.
|
|
func (su *StatsUpdate) SetMvp(u uint) *StatsUpdate {
|
|
su.mutation.ResetMvp()
|
|
su.mutation.SetMvp(u)
|
|
return su
|
|
}
|
|
|
|
// AddMvp adds u to the "mvp" field.
|
|
func (su *StatsUpdate) AddMvp(u uint) *StatsUpdate {
|
|
su.mutation.AddMvp(u)
|
|
return su
|
|
}
|
|
|
|
// SetScore sets the "score" field.
|
|
func (su *StatsUpdate) SetScore(i int) *StatsUpdate {
|
|
su.mutation.ResetScore()
|
|
su.mutation.SetScore(i)
|
|
return su
|
|
}
|
|
|
|
// AddScore adds i to the "score" field.
|
|
func (su *StatsUpdate) AddScore(i int) *StatsUpdate {
|
|
su.mutation.AddScore(i)
|
|
return su
|
|
}
|
|
|
|
// SetRankNew sets the "rank_new" field.
|
|
func (su *StatsUpdate) SetRankNew(i int) *StatsUpdate {
|
|
su.mutation.ResetRankNew()
|
|
su.mutation.SetRankNew(i)
|
|
return su
|
|
}
|
|
|
|
// SetNillableRankNew sets the "rank_new" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableRankNew(i *int) *StatsUpdate {
|
|
if i != nil {
|
|
su.SetRankNew(*i)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddRankNew adds i to the "rank_new" field.
|
|
func (su *StatsUpdate) AddRankNew(i int) *StatsUpdate {
|
|
su.mutation.AddRankNew(i)
|
|
return su
|
|
}
|
|
|
|
// ClearRankNew clears the value of the "rank_new" field.
|
|
func (su *StatsUpdate) ClearRankNew() *StatsUpdate {
|
|
su.mutation.ClearRankNew()
|
|
return su
|
|
}
|
|
|
|
// SetRankOld sets the "rank_old" field.
|
|
func (su *StatsUpdate) SetRankOld(i int) *StatsUpdate {
|
|
su.mutation.ResetRankOld()
|
|
su.mutation.SetRankOld(i)
|
|
return su
|
|
}
|
|
|
|
// SetNillableRankOld sets the "rank_old" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableRankOld(i *int) *StatsUpdate {
|
|
if i != nil {
|
|
su.SetRankOld(*i)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddRankOld adds i to the "rank_old" field.
|
|
func (su *StatsUpdate) AddRankOld(i int) *StatsUpdate {
|
|
su.mutation.AddRankOld(i)
|
|
return su
|
|
}
|
|
|
|
// ClearRankOld clears the value of the "rank_old" field.
|
|
func (su *StatsUpdate) ClearRankOld() *StatsUpdate {
|
|
su.mutation.ClearRankOld()
|
|
return su
|
|
}
|
|
|
|
// SetMk2 sets the "mk_2" field.
|
|
func (su *StatsUpdate) SetMk2(u uint) *StatsUpdate {
|
|
su.mutation.ResetMk2()
|
|
su.mutation.SetMk2(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMk2 sets the "mk_2" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMk2(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetMk2(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddMk2 adds u to the "mk_2" field.
|
|
func (su *StatsUpdate) AddMk2(u uint) *StatsUpdate {
|
|
su.mutation.AddMk2(u)
|
|
return su
|
|
}
|
|
|
|
// ClearMk2 clears the value of the "mk_2" field.
|
|
func (su *StatsUpdate) ClearMk2() *StatsUpdate {
|
|
su.mutation.ClearMk2()
|
|
return su
|
|
}
|
|
|
|
// SetMk3 sets the "mk_3" field.
|
|
func (su *StatsUpdate) SetMk3(u uint) *StatsUpdate {
|
|
su.mutation.ResetMk3()
|
|
su.mutation.SetMk3(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMk3 sets the "mk_3" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMk3(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetMk3(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddMk3 adds u to the "mk_3" field.
|
|
func (su *StatsUpdate) AddMk3(u uint) *StatsUpdate {
|
|
su.mutation.AddMk3(u)
|
|
return su
|
|
}
|
|
|
|
// ClearMk3 clears the value of the "mk_3" field.
|
|
func (su *StatsUpdate) ClearMk3() *StatsUpdate {
|
|
su.mutation.ClearMk3()
|
|
return su
|
|
}
|
|
|
|
// SetMk4 sets the "mk_4" field.
|
|
func (su *StatsUpdate) SetMk4(u uint) *StatsUpdate {
|
|
su.mutation.ResetMk4()
|
|
su.mutation.SetMk4(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMk4 sets the "mk_4" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMk4(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetMk4(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddMk4 adds u to the "mk_4" field.
|
|
func (su *StatsUpdate) AddMk4(u uint) *StatsUpdate {
|
|
su.mutation.AddMk4(u)
|
|
return su
|
|
}
|
|
|
|
// ClearMk4 clears the value of the "mk_4" field.
|
|
func (su *StatsUpdate) ClearMk4() *StatsUpdate {
|
|
su.mutation.ClearMk4()
|
|
return su
|
|
}
|
|
|
|
// SetMk5 sets the "mk_5" field.
|
|
func (su *StatsUpdate) SetMk5(u uint) *StatsUpdate {
|
|
su.mutation.ResetMk5()
|
|
su.mutation.SetMk5(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMk5 sets the "mk_5" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMk5(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetMk5(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddMk5 adds u to the "mk_5" field.
|
|
func (su *StatsUpdate) AddMk5(u uint) *StatsUpdate {
|
|
su.mutation.AddMk5(u)
|
|
return su
|
|
}
|
|
|
|
// ClearMk5 clears the value of the "mk_5" field.
|
|
func (su *StatsUpdate) ClearMk5() *StatsUpdate {
|
|
su.mutation.ClearMk5()
|
|
return su
|
|
}
|
|
|
|
// SetDmgEnemy sets the "dmg_enemy" field.
|
|
func (su *StatsUpdate) SetDmgEnemy(u uint) *StatsUpdate {
|
|
su.mutation.ResetDmgEnemy()
|
|
su.mutation.SetDmgEnemy(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableDmgEnemy sets the "dmg_enemy" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableDmgEnemy(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetDmgEnemy(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddDmgEnemy adds u to the "dmg_enemy" field.
|
|
func (su *StatsUpdate) AddDmgEnemy(u uint) *StatsUpdate {
|
|
su.mutation.AddDmgEnemy(u)
|
|
return su
|
|
}
|
|
|
|
// ClearDmgEnemy clears the value of the "dmg_enemy" field.
|
|
func (su *StatsUpdate) ClearDmgEnemy() *StatsUpdate {
|
|
su.mutation.ClearDmgEnemy()
|
|
return su
|
|
}
|
|
|
|
// SetDmgTeam sets the "dmg_team" field.
|
|
func (su *StatsUpdate) SetDmgTeam(u uint) *StatsUpdate {
|
|
su.mutation.ResetDmgTeam()
|
|
su.mutation.SetDmgTeam(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableDmgTeam sets the "dmg_team" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableDmgTeam(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetDmgTeam(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddDmgTeam adds u to the "dmg_team" field.
|
|
func (su *StatsUpdate) AddDmgTeam(u uint) *StatsUpdate {
|
|
su.mutation.AddDmgTeam(u)
|
|
return su
|
|
}
|
|
|
|
// ClearDmgTeam clears the value of the "dmg_team" field.
|
|
func (su *StatsUpdate) ClearDmgTeam() *StatsUpdate {
|
|
su.mutation.ClearDmgTeam()
|
|
return su
|
|
}
|
|
|
|
// SetUdHe sets the "ud_he" field.
|
|
func (su *StatsUpdate) SetUdHe(u uint) *StatsUpdate {
|
|
su.mutation.ResetUdHe()
|
|
su.mutation.SetUdHe(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableUdHe sets the "ud_he" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableUdHe(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetUdHe(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddUdHe adds u to the "ud_he" field.
|
|
func (su *StatsUpdate) AddUdHe(u uint) *StatsUpdate {
|
|
su.mutation.AddUdHe(u)
|
|
return su
|
|
}
|
|
|
|
// ClearUdHe clears the value of the "ud_he" field.
|
|
func (su *StatsUpdate) ClearUdHe() *StatsUpdate {
|
|
su.mutation.ClearUdHe()
|
|
return su
|
|
}
|
|
|
|
// SetUdFlames sets the "ud_flames" field.
|
|
func (su *StatsUpdate) SetUdFlames(u uint) *StatsUpdate {
|
|
su.mutation.ResetUdFlames()
|
|
su.mutation.SetUdFlames(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableUdFlames sets the "ud_flames" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableUdFlames(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetUdFlames(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddUdFlames adds u to the "ud_flames" field.
|
|
func (su *StatsUpdate) AddUdFlames(u uint) *StatsUpdate {
|
|
su.mutation.AddUdFlames(u)
|
|
return su
|
|
}
|
|
|
|
// ClearUdFlames clears the value of the "ud_flames" field.
|
|
func (su *StatsUpdate) ClearUdFlames() *StatsUpdate {
|
|
su.mutation.ClearUdFlames()
|
|
return su
|
|
}
|
|
|
|
// SetUdFlash sets the "ud_flash" field.
|
|
func (su *StatsUpdate) SetUdFlash(u uint) *StatsUpdate {
|
|
su.mutation.ResetUdFlash()
|
|
su.mutation.SetUdFlash(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableUdFlash sets the "ud_flash" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableUdFlash(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetUdFlash(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddUdFlash adds u to the "ud_flash" field.
|
|
func (su *StatsUpdate) AddUdFlash(u uint) *StatsUpdate {
|
|
su.mutation.AddUdFlash(u)
|
|
return su
|
|
}
|
|
|
|
// ClearUdFlash clears the value of the "ud_flash" field.
|
|
func (su *StatsUpdate) ClearUdFlash() *StatsUpdate {
|
|
su.mutation.ClearUdFlash()
|
|
return su
|
|
}
|
|
|
|
// SetUdDecoy sets the "ud_decoy" field.
|
|
func (su *StatsUpdate) SetUdDecoy(u uint) *StatsUpdate {
|
|
su.mutation.ResetUdDecoy()
|
|
su.mutation.SetUdDecoy(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableUdDecoy sets the "ud_decoy" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableUdDecoy(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetUdDecoy(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddUdDecoy adds u to the "ud_decoy" field.
|
|
func (su *StatsUpdate) AddUdDecoy(u uint) *StatsUpdate {
|
|
su.mutation.AddUdDecoy(u)
|
|
return su
|
|
}
|
|
|
|
// ClearUdDecoy clears the value of the "ud_decoy" field.
|
|
func (su *StatsUpdate) ClearUdDecoy() *StatsUpdate {
|
|
su.mutation.ClearUdDecoy()
|
|
return su
|
|
}
|
|
|
|
// SetUdSmoke sets the "ud_smoke" field.
|
|
func (su *StatsUpdate) SetUdSmoke(u uint) *StatsUpdate {
|
|
su.mutation.ResetUdSmoke()
|
|
su.mutation.SetUdSmoke(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableUdSmoke sets the "ud_smoke" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableUdSmoke(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetUdSmoke(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddUdSmoke adds u to the "ud_smoke" field.
|
|
func (su *StatsUpdate) AddUdSmoke(u uint) *StatsUpdate {
|
|
su.mutation.AddUdSmoke(u)
|
|
return su
|
|
}
|
|
|
|
// ClearUdSmoke clears the value of the "ud_smoke" field.
|
|
func (su *StatsUpdate) ClearUdSmoke() *StatsUpdate {
|
|
su.mutation.ClearUdSmoke()
|
|
return su
|
|
}
|
|
|
|
// SetCrosshair sets the "crosshair" field.
|
|
func (su *StatsUpdate) SetCrosshair(s string) *StatsUpdate {
|
|
su.mutation.SetCrosshair(s)
|
|
return su
|
|
}
|
|
|
|
// SetNillableCrosshair sets the "crosshair" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableCrosshair(s *string) *StatsUpdate {
|
|
if s != nil {
|
|
su.SetCrosshair(*s)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// ClearCrosshair clears the value of the "crosshair" field.
|
|
func (su *StatsUpdate) ClearCrosshair() *StatsUpdate {
|
|
su.mutation.ClearCrosshair()
|
|
return su
|
|
}
|
|
|
|
// SetColor sets the "color" field.
|
|
func (su *StatsUpdate) SetColor(s stats.Color) *StatsUpdate {
|
|
su.mutation.SetColor(s)
|
|
return su
|
|
}
|
|
|
|
// SetNillableColor sets the "color" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableColor(s *stats.Color) *StatsUpdate {
|
|
if s != nil {
|
|
su.SetColor(*s)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// ClearColor clears the value of the "color" field.
|
|
func (su *StatsUpdate) ClearColor() *StatsUpdate {
|
|
su.mutation.ClearColor()
|
|
return su
|
|
}
|
|
|
|
// SetKast sets the "kast" field.
|
|
func (su *StatsUpdate) SetKast(i int) *StatsUpdate {
|
|
su.mutation.ResetKast()
|
|
su.mutation.SetKast(i)
|
|
return su
|
|
}
|
|
|
|
// SetNillableKast sets the "kast" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableKast(i *int) *StatsUpdate {
|
|
if i != nil {
|
|
su.SetKast(*i)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddKast adds i to the "kast" field.
|
|
func (su *StatsUpdate) AddKast(i int) *StatsUpdate {
|
|
su.mutation.AddKast(i)
|
|
return su
|
|
}
|
|
|
|
// ClearKast clears the value of the "kast" field.
|
|
func (su *StatsUpdate) ClearKast() *StatsUpdate {
|
|
su.mutation.ClearKast()
|
|
return su
|
|
}
|
|
|
|
// SetFlashDurationSelf sets the "flash_duration_self" field.
|
|
func (su *StatsUpdate) SetFlashDurationSelf(f float32) *StatsUpdate {
|
|
su.mutation.ResetFlashDurationSelf()
|
|
su.mutation.SetFlashDurationSelf(f)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashDurationSelf sets the "flash_duration_self" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashDurationSelf(f *float32) *StatsUpdate {
|
|
if f != nil {
|
|
su.SetFlashDurationSelf(*f)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashDurationSelf adds f to the "flash_duration_self" field.
|
|
func (su *StatsUpdate) AddFlashDurationSelf(f float32) *StatsUpdate {
|
|
su.mutation.AddFlashDurationSelf(f)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashDurationSelf clears the value of the "flash_duration_self" field.
|
|
func (su *StatsUpdate) ClearFlashDurationSelf() *StatsUpdate {
|
|
su.mutation.ClearFlashDurationSelf()
|
|
return su
|
|
}
|
|
|
|
// SetFlashDurationTeam sets the "flash_duration_team" field.
|
|
func (su *StatsUpdate) SetFlashDurationTeam(f float32) *StatsUpdate {
|
|
su.mutation.ResetFlashDurationTeam()
|
|
su.mutation.SetFlashDurationTeam(f)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashDurationTeam sets the "flash_duration_team" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashDurationTeam(f *float32) *StatsUpdate {
|
|
if f != nil {
|
|
su.SetFlashDurationTeam(*f)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashDurationTeam adds f to the "flash_duration_team" field.
|
|
func (su *StatsUpdate) AddFlashDurationTeam(f float32) *StatsUpdate {
|
|
su.mutation.AddFlashDurationTeam(f)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashDurationTeam clears the value of the "flash_duration_team" field.
|
|
func (su *StatsUpdate) ClearFlashDurationTeam() *StatsUpdate {
|
|
su.mutation.ClearFlashDurationTeam()
|
|
return su
|
|
}
|
|
|
|
// SetFlashDurationEnemy sets the "flash_duration_enemy" field.
|
|
func (su *StatsUpdate) SetFlashDurationEnemy(f float32) *StatsUpdate {
|
|
su.mutation.ResetFlashDurationEnemy()
|
|
su.mutation.SetFlashDurationEnemy(f)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashDurationEnemy sets the "flash_duration_enemy" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashDurationEnemy(f *float32) *StatsUpdate {
|
|
if f != nil {
|
|
su.SetFlashDurationEnemy(*f)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashDurationEnemy adds f to the "flash_duration_enemy" field.
|
|
func (su *StatsUpdate) AddFlashDurationEnemy(f float32) *StatsUpdate {
|
|
su.mutation.AddFlashDurationEnemy(f)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashDurationEnemy clears the value of the "flash_duration_enemy" field.
|
|
func (su *StatsUpdate) ClearFlashDurationEnemy() *StatsUpdate {
|
|
su.mutation.ClearFlashDurationEnemy()
|
|
return su
|
|
}
|
|
|
|
// SetFlashTotalSelf sets the "flash_total_self" field.
|
|
func (su *StatsUpdate) SetFlashTotalSelf(u uint) *StatsUpdate {
|
|
su.mutation.ResetFlashTotalSelf()
|
|
su.mutation.SetFlashTotalSelf(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashTotalSelf sets the "flash_total_self" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashTotalSelf(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetFlashTotalSelf(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashTotalSelf adds u to the "flash_total_self" field.
|
|
func (su *StatsUpdate) AddFlashTotalSelf(u uint) *StatsUpdate {
|
|
su.mutation.AddFlashTotalSelf(u)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashTotalSelf clears the value of the "flash_total_self" field.
|
|
func (su *StatsUpdate) ClearFlashTotalSelf() *StatsUpdate {
|
|
su.mutation.ClearFlashTotalSelf()
|
|
return su
|
|
}
|
|
|
|
// SetFlashTotalTeam sets the "flash_total_team" field.
|
|
func (su *StatsUpdate) SetFlashTotalTeam(u uint) *StatsUpdate {
|
|
su.mutation.ResetFlashTotalTeam()
|
|
su.mutation.SetFlashTotalTeam(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashTotalTeam sets the "flash_total_team" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashTotalTeam(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetFlashTotalTeam(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashTotalTeam adds u to the "flash_total_team" field.
|
|
func (su *StatsUpdate) AddFlashTotalTeam(u uint) *StatsUpdate {
|
|
su.mutation.AddFlashTotalTeam(u)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashTotalTeam clears the value of the "flash_total_team" field.
|
|
func (su *StatsUpdate) ClearFlashTotalTeam() *StatsUpdate {
|
|
su.mutation.ClearFlashTotalTeam()
|
|
return su
|
|
}
|
|
|
|
// SetFlashTotalEnemy sets the "flash_total_enemy" field.
|
|
func (su *StatsUpdate) SetFlashTotalEnemy(u uint) *StatsUpdate {
|
|
su.mutation.ResetFlashTotalEnemy()
|
|
su.mutation.SetFlashTotalEnemy(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableFlashTotalEnemy sets the "flash_total_enemy" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableFlashTotalEnemy(u *uint) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetFlashTotalEnemy(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// AddFlashTotalEnemy adds u to the "flash_total_enemy" field.
|
|
func (su *StatsUpdate) AddFlashTotalEnemy(u uint) *StatsUpdate {
|
|
su.mutation.AddFlashTotalEnemy(u)
|
|
return su
|
|
}
|
|
|
|
// ClearFlashTotalEnemy clears the value of the "flash_total_enemy" field.
|
|
func (su *StatsUpdate) ClearFlashTotalEnemy() *StatsUpdate {
|
|
su.mutation.ClearFlashTotalEnemy()
|
|
return su
|
|
}
|
|
|
|
// SetMatchStats sets the "match_stats" field.
|
|
func (su *StatsUpdate) SetMatchStats(u uint64) *StatsUpdate {
|
|
su.mutation.SetMatchStats(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMatchStats sets the "match_stats" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMatchStats(u *uint64) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetMatchStats(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// ClearMatchStats clears the value of the "match_stats" field.
|
|
func (su *StatsUpdate) ClearMatchStats() *StatsUpdate {
|
|
su.mutation.ClearMatchStats()
|
|
return su
|
|
}
|
|
|
|
// SetPlayerStats sets the "player_stats" field.
|
|
func (su *StatsUpdate) SetPlayerStats(u uint64) *StatsUpdate {
|
|
su.mutation.SetPlayerStats(u)
|
|
return su
|
|
}
|
|
|
|
// SetNillablePlayerStats sets the "player_stats" field if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillablePlayerStats(u *uint64) *StatsUpdate {
|
|
if u != nil {
|
|
su.SetPlayerStats(*u)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// ClearPlayerStats clears the value of the "player_stats" field.
|
|
func (su *StatsUpdate) ClearPlayerStats() *StatsUpdate {
|
|
su.mutation.ClearPlayerStats()
|
|
return su
|
|
}
|
|
|
|
// SetMatchesID sets the "matches" edge to the Match entity by ID.
|
|
func (su *StatsUpdate) SetMatchesID(id uint64) *StatsUpdate {
|
|
su.mutation.SetMatchesID(id)
|
|
return su
|
|
}
|
|
|
|
// SetNillableMatchesID sets the "matches" edge to the Match entity by ID if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillableMatchesID(id *uint64) *StatsUpdate {
|
|
if id != nil {
|
|
su = su.SetMatchesID(*id)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// SetMatches sets the "matches" edge to the Match entity.
|
|
func (su *StatsUpdate) SetMatches(m *Match) *StatsUpdate {
|
|
return su.SetMatchesID(m.ID)
|
|
}
|
|
|
|
// SetPlayersID sets the "players" edge to the Player entity by ID.
|
|
func (su *StatsUpdate) SetPlayersID(id uint64) *StatsUpdate {
|
|
su.mutation.SetPlayersID(id)
|
|
return su
|
|
}
|
|
|
|
// SetNillablePlayersID sets the "players" edge to the Player entity by ID if the given value is not nil.
|
|
func (su *StatsUpdate) SetNillablePlayersID(id *uint64) *StatsUpdate {
|
|
if id != nil {
|
|
su = su.SetPlayersID(*id)
|
|
}
|
|
return su
|
|
}
|
|
|
|
// SetPlayers sets the "players" edge to the Player entity.
|
|
func (su *StatsUpdate) SetPlayers(p *Player) *StatsUpdate {
|
|
return su.SetPlayersID(p.ID)
|
|
}
|
|
|
|
// AddWeaponStatIDs adds the "weapon_stats" edge to the WeaponStats entity by IDs.
|
|
func (su *StatsUpdate) AddWeaponStatIDs(ids ...int) *StatsUpdate {
|
|
su.mutation.AddWeaponStatIDs(ids...)
|
|
return su
|
|
}
|
|
|
|
// AddWeaponStats adds the "weapon_stats" edges to the WeaponStats entity.
|
|
func (su *StatsUpdate) AddWeaponStats(w ...*WeaponStats) *StatsUpdate {
|
|
ids := make([]int, len(w))
|
|
for i := range w {
|
|
ids[i] = w[i].ID
|
|
}
|
|
return su.AddWeaponStatIDs(ids...)
|
|
}
|
|
|
|
// AddRoundStatIDs adds the "round_stats" edge to the RoundStats entity by IDs.
|
|
func (su *StatsUpdate) AddRoundStatIDs(ids ...int) *StatsUpdate {
|
|
su.mutation.AddRoundStatIDs(ids...)
|
|
return su
|
|
}
|
|
|
|
// AddRoundStats adds the "round_stats" edges to the RoundStats entity.
|
|
func (su *StatsUpdate) AddRoundStats(r ...*RoundStats) *StatsUpdate {
|
|
ids := make([]int, len(r))
|
|
for i := range r {
|
|
ids[i] = r[i].ID
|
|
}
|
|
return su.AddRoundStatIDs(ids...)
|
|
}
|
|
|
|
// Mutation returns the StatsMutation object of the builder.
|
|
func (su *StatsUpdate) Mutation() *StatsMutation {
|
|
return su.mutation
|
|
}
|
|
|
|
// ClearMatches clears the "matches" edge to the Match entity.
|
|
func (su *StatsUpdate) ClearMatches() *StatsUpdate {
|
|
su.mutation.ClearMatches()
|
|
return su
|
|
}
|
|
|
|
// ClearPlayers clears the "players" edge to the Player entity.
|
|
func (su *StatsUpdate) ClearPlayers() *StatsUpdate {
|
|
su.mutation.ClearPlayers()
|
|
return su
|
|
}
|
|
|
|
// ClearWeaponStats clears all "weapon_stats" edges to the WeaponStats entity.
|
|
func (su *StatsUpdate) ClearWeaponStats() *StatsUpdate {
|
|
su.mutation.ClearWeaponStats()
|
|
return su
|
|
}
|
|
|
|
// RemoveWeaponStatIDs removes the "weapon_stats" edge to WeaponStats entities by IDs.
|
|
func (su *StatsUpdate) RemoveWeaponStatIDs(ids ...int) *StatsUpdate {
|
|
su.mutation.RemoveWeaponStatIDs(ids...)
|
|
return su
|
|
}
|
|
|
|
// RemoveWeaponStats removes "weapon_stats" edges to WeaponStats entities.
|
|
func (su *StatsUpdate) RemoveWeaponStats(w ...*WeaponStats) *StatsUpdate {
|
|
ids := make([]int, len(w))
|
|
for i := range w {
|
|
ids[i] = w[i].ID
|
|
}
|
|
return su.RemoveWeaponStatIDs(ids...)
|
|
}
|
|
|
|
// ClearRoundStats clears all "round_stats" edges to the RoundStats entity.
|
|
func (su *StatsUpdate) ClearRoundStats() *StatsUpdate {
|
|
su.mutation.ClearRoundStats()
|
|
return su
|
|
}
|
|
|
|
// RemoveRoundStatIDs removes the "round_stats" edge to RoundStats entities by IDs.
|
|
func (su *StatsUpdate) RemoveRoundStatIDs(ids ...int) *StatsUpdate {
|
|
su.mutation.RemoveRoundStatIDs(ids...)
|
|
return su
|
|
}
|
|
|
|
// RemoveRoundStats removes "round_stats" edges to RoundStats entities.
|
|
func (su *StatsUpdate) RemoveRoundStats(r ...*RoundStats) *StatsUpdate {
|
|
ids := make([]int, len(r))
|
|
for i := range r {
|
|
ids[i] = r[i].ID
|
|
}
|
|
return su.RemoveRoundStatIDs(ids...)
|
|
}
|
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
func (su *StatsUpdate) Save(ctx context.Context) (int, error) {
|
|
var (
|
|
err error
|
|
affected int
|
|
)
|
|
if len(su.hooks) == 0 {
|
|
if err = su.check(); err != nil {
|
|
return 0, err
|
|
}
|
|
affected, err = su.sqlSave(ctx)
|
|
} else {
|
|
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
|
mutation, ok := m.(*StatsMutation)
|
|
if !ok {
|
|
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
|
}
|
|
if err = su.check(); err != nil {
|
|
return 0, err
|
|
}
|
|
su.mutation = mutation
|
|
affected, err = su.sqlSave(ctx)
|
|
mutation.done = true
|
|
return affected, err
|
|
})
|
|
for i := len(su.hooks) - 1; i >= 0; i-- {
|
|
if su.hooks[i] == nil {
|
|
return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
|
|
}
|
|
mut = su.hooks[i](mut)
|
|
}
|
|
if _, err := mut.Mutate(ctx, su.mutation); err != nil {
|
|
return 0, err
|
|
}
|
|
}
|
|
return affected, err
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (su *StatsUpdate) SaveX(ctx context.Context) int {
|
|
affected, err := su.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return affected
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (su *StatsUpdate) Exec(ctx context.Context) error {
|
|
_, err := su.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (su *StatsUpdate) ExecX(ctx context.Context) {
|
|
if err := su.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (su *StatsUpdate) check() error {
|
|
if v, ok := su.mutation.Color(); ok {
|
|
if err := stats.ColorValidator(v); err != nil {
|
|
return &ValidationError{Name: "color", err: fmt.Errorf("ent: validator failed for field \"color\": %w", err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (su *StatsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|
_spec := &sqlgraph.UpdateSpec{
|
|
Node: &sqlgraph.NodeSpec{
|
|
Table: stats.Table,
|
|
Columns: stats.Columns,
|
|
ID: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
if ps := su.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := su.mutation.TeamID(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldTeamID,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedTeamID(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldTeamID,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Kills(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKills,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedKills(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKills,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Deaths(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldDeaths,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedDeaths(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldDeaths,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Assists(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldAssists,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedAssists(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldAssists,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Headshot(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldHeadshot,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedHeadshot(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldHeadshot,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Mvp(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMvp,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedMvp(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMvp,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Score(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldScore,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedScore(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldScore,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.RankNew(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedRankNew(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if su.mutation.RankNewCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.RankOld(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedRankOld(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if su.mutation.RankOldCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Mk2(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedMk2(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if su.mutation.Mk2Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Mk3(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedMk3(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if su.mutation.Mk3Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Mk4(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedMk4(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if su.mutation.Mk4Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Mk5(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedMk5(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if su.mutation.Mk5Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.DmgEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedDmgEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if su.mutation.DmgEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.DmgTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedDmgTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if su.mutation.DmgTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.UdHe(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedUdHe(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if su.mutation.UdHeCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.UdFlames(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedUdFlames(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if su.mutation.UdFlamesCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.UdFlash(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedUdFlash(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if su.mutation.UdFlashCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.UdDecoy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedUdDecoy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if su.mutation.UdDecoyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.UdSmoke(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedUdSmoke(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if su.mutation.UdSmokeCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Crosshair(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeString,
|
|
Value: value,
|
|
Column: stats.FieldCrosshair,
|
|
})
|
|
}
|
|
if su.mutation.CrosshairCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeString,
|
|
Column: stats.FieldCrosshair,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Color(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeEnum,
|
|
Value: value,
|
|
Column: stats.FieldColor,
|
|
})
|
|
}
|
|
if su.mutation.ColorCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeEnum,
|
|
Column: stats.FieldColor,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.Kast(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedKast(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if su.mutation.KastCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashDurationSelf(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashDurationSelf(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if su.mutation.FlashDurationSelfCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashDurationTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashDurationTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if su.mutation.FlashDurationTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashDurationEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashDurationEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if su.mutation.FlashDurationEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashTotalSelf(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashTotalSelf(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if su.mutation.FlashTotalSelfCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashTotalTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashTotalTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if su.mutation.FlashTotalTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.FlashTotalEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if value, ok := su.mutation.AddedFlashTotalEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if su.mutation.FlashTotalEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if su.mutation.MatchesCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.MatchesTable,
|
|
Columns: []string{stats.MatchesColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: match.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.MatchesIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.MatchesTable,
|
|
Columns: []string{stats.MatchesColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: match.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if su.mutation.PlayersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.PlayersTable,
|
|
Columns: []string{stats.PlayersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: player.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.PlayersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.PlayersTable,
|
|
Columns: []string{stats.PlayersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: player.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if su.mutation.WeaponStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.RemovedWeaponStatsIDs(); len(nodes) > 0 && !su.mutation.WeaponStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.WeaponStatsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if su.mutation.RoundStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.RemovedRoundStatsIDs(); len(nodes) > 0 && !su.mutation.RoundStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := su.mutation.RoundStatsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if n, err = sqlgraph.UpdateNodes(ctx, su.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{stats.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{err.Error(), err}
|
|
}
|
|
return 0, err
|
|
}
|
|
return n, nil
|
|
}
|
|
|
|
// StatsUpdateOne is the builder for updating a single Stats entity.
|
|
type StatsUpdateOne struct {
|
|
config
|
|
fields []string
|
|
hooks []Hook
|
|
mutation *StatsMutation
|
|
}
|
|
|
|
// SetTeamID sets the "team_id" field.
|
|
func (suo *StatsUpdateOne) SetTeamID(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetTeamID()
|
|
suo.mutation.SetTeamID(i)
|
|
return suo
|
|
}
|
|
|
|
// AddTeamID adds i to the "team_id" field.
|
|
func (suo *StatsUpdateOne) AddTeamID(i int) *StatsUpdateOne {
|
|
suo.mutation.AddTeamID(i)
|
|
return suo
|
|
}
|
|
|
|
// SetKills sets the "kills" field.
|
|
func (suo *StatsUpdateOne) SetKills(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetKills()
|
|
suo.mutation.SetKills(i)
|
|
return suo
|
|
}
|
|
|
|
// AddKills adds i to the "kills" field.
|
|
func (suo *StatsUpdateOne) AddKills(i int) *StatsUpdateOne {
|
|
suo.mutation.AddKills(i)
|
|
return suo
|
|
}
|
|
|
|
// SetDeaths sets the "deaths" field.
|
|
func (suo *StatsUpdateOne) SetDeaths(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetDeaths()
|
|
suo.mutation.SetDeaths(i)
|
|
return suo
|
|
}
|
|
|
|
// AddDeaths adds i to the "deaths" field.
|
|
func (suo *StatsUpdateOne) AddDeaths(i int) *StatsUpdateOne {
|
|
suo.mutation.AddDeaths(i)
|
|
return suo
|
|
}
|
|
|
|
// SetAssists sets the "assists" field.
|
|
func (suo *StatsUpdateOne) SetAssists(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetAssists()
|
|
suo.mutation.SetAssists(i)
|
|
return suo
|
|
}
|
|
|
|
// AddAssists adds i to the "assists" field.
|
|
func (suo *StatsUpdateOne) AddAssists(i int) *StatsUpdateOne {
|
|
suo.mutation.AddAssists(i)
|
|
return suo
|
|
}
|
|
|
|
// SetHeadshot sets the "headshot" field.
|
|
func (suo *StatsUpdateOne) SetHeadshot(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetHeadshot()
|
|
suo.mutation.SetHeadshot(i)
|
|
return suo
|
|
}
|
|
|
|
// AddHeadshot adds i to the "headshot" field.
|
|
func (suo *StatsUpdateOne) AddHeadshot(i int) *StatsUpdateOne {
|
|
suo.mutation.AddHeadshot(i)
|
|
return suo
|
|
}
|
|
|
|
// SetMvp sets the "mvp" field.
|
|
func (suo *StatsUpdateOne) SetMvp(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetMvp()
|
|
suo.mutation.SetMvp(u)
|
|
return suo
|
|
}
|
|
|
|
// AddMvp adds u to the "mvp" field.
|
|
func (suo *StatsUpdateOne) AddMvp(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddMvp(u)
|
|
return suo
|
|
}
|
|
|
|
// SetScore sets the "score" field.
|
|
func (suo *StatsUpdateOne) SetScore(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetScore()
|
|
suo.mutation.SetScore(i)
|
|
return suo
|
|
}
|
|
|
|
// AddScore adds i to the "score" field.
|
|
func (suo *StatsUpdateOne) AddScore(i int) *StatsUpdateOne {
|
|
suo.mutation.AddScore(i)
|
|
return suo
|
|
}
|
|
|
|
// SetRankNew sets the "rank_new" field.
|
|
func (suo *StatsUpdateOne) SetRankNew(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetRankNew()
|
|
suo.mutation.SetRankNew(i)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableRankNew sets the "rank_new" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableRankNew(i *int) *StatsUpdateOne {
|
|
if i != nil {
|
|
suo.SetRankNew(*i)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddRankNew adds i to the "rank_new" field.
|
|
func (suo *StatsUpdateOne) AddRankNew(i int) *StatsUpdateOne {
|
|
suo.mutation.AddRankNew(i)
|
|
return suo
|
|
}
|
|
|
|
// ClearRankNew clears the value of the "rank_new" field.
|
|
func (suo *StatsUpdateOne) ClearRankNew() *StatsUpdateOne {
|
|
suo.mutation.ClearRankNew()
|
|
return suo
|
|
}
|
|
|
|
// SetRankOld sets the "rank_old" field.
|
|
func (suo *StatsUpdateOne) SetRankOld(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetRankOld()
|
|
suo.mutation.SetRankOld(i)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableRankOld sets the "rank_old" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableRankOld(i *int) *StatsUpdateOne {
|
|
if i != nil {
|
|
suo.SetRankOld(*i)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddRankOld adds i to the "rank_old" field.
|
|
func (suo *StatsUpdateOne) AddRankOld(i int) *StatsUpdateOne {
|
|
suo.mutation.AddRankOld(i)
|
|
return suo
|
|
}
|
|
|
|
// ClearRankOld clears the value of the "rank_old" field.
|
|
func (suo *StatsUpdateOne) ClearRankOld() *StatsUpdateOne {
|
|
suo.mutation.ClearRankOld()
|
|
return suo
|
|
}
|
|
|
|
// SetMk2 sets the "mk_2" field.
|
|
func (suo *StatsUpdateOne) SetMk2(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetMk2()
|
|
suo.mutation.SetMk2(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMk2 sets the "mk_2" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMk2(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetMk2(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddMk2 adds u to the "mk_2" field.
|
|
func (suo *StatsUpdateOne) AddMk2(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddMk2(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearMk2 clears the value of the "mk_2" field.
|
|
func (suo *StatsUpdateOne) ClearMk2() *StatsUpdateOne {
|
|
suo.mutation.ClearMk2()
|
|
return suo
|
|
}
|
|
|
|
// SetMk3 sets the "mk_3" field.
|
|
func (suo *StatsUpdateOne) SetMk3(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetMk3()
|
|
suo.mutation.SetMk3(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMk3 sets the "mk_3" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMk3(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetMk3(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddMk3 adds u to the "mk_3" field.
|
|
func (suo *StatsUpdateOne) AddMk3(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddMk3(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearMk3 clears the value of the "mk_3" field.
|
|
func (suo *StatsUpdateOne) ClearMk3() *StatsUpdateOne {
|
|
suo.mutation.ClearMk3()
|
|
return suo
|
|
}
|
|
|
|
// SetMk4 sets the "mk_4" field.
|
|
func (suo *StatsUpdateOne) SetMk4(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetMk4()
|
|
suo.mutation.SetMk4(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMk4 sets the "mk_4" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMk4(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetMk4(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddMk4 adds u to the "mk_4" field.
|
|
func (suo *StatsUpdateOne) AddMk4(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddMk4(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearMk4 clears the value of the "mk_4" field.
|
|
func (suo *StatsUpdateOne) ClearMk4() *StatsUpdateOne {
|
|
suo.mutation.ClearMk4()
|
|
return suo
|
|
}
|
|
|
|
// SetMk5 sets the "mk_5" field.
|
|
func (suo *StatsUpdateOne) SetMk5(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetMk5()
|
|
suo.mutation.SetMk5(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMk5 sets the "mk_5" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMk5(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetMk5(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddMk5 adds u to the "mk_5" field.
|
|
func (suo *StatsUpdateOne) AddMk5(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddMk5(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearMk5 clears the value of the "mk_5" field.
|
|
func (suo *StatsUpdateOne) ClearMk5() *StatsUpdateOne {
|
|
suo.mutation.ClearMk5()
|
|
return suo
|
|
}
|
|
|
|
// SetDmgEnemy sets the "dmg_enemy" field.
|
|
func (suo *StatsUpdateOne) SetDmgEnemy(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetDmgEnemy()
|
|
suo.mutation.SetDmgEnemy(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableDmgEnemy sets the "dmg_enemy" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableDmgEnemy(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetDmgEnemy(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddDmgEnemy adds u to the "dmg_enemy" field.
|
|
func (suo *StatsUpdateOne) AddDmgEnemy(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddDmgEnemy(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearDmgEnemy clears the value of the "dmg_enemy" field.
|
|
func (suo *StatsUpdateOne) ClearDmgEnemy() *StatsUpdateOne {
|
|
suo.mutation.ClearDmgEnemy()
|
|
return suo
|
|
}
|
|
|
|
// SetDmgTeam sets the "dmg_team" field.
|
|
func (suo *StatsUpdateOne) SetDmgTeam(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetDmgTeam()
|
|
suo.mutation.SetDmgTeam(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableDmgTeam sets the "dmg_team" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableDmgTeam(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetDmgTeam(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddDmgTeam adds u to the "dmg_team" field.
|
|
func (suo *StatsUpdateOne) AddDmgTeam(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddDmgTeam(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearDmgTeam clears the value of the "dmg_team" field.
|
|
func (suo *StatsUpdateOne) ClearDmgTeam() *StatsUpdateOne {
|
|
suo.mutation.ClearDmgTeam()
|
|
return suo
|
|
}
|
|
|
|
// SetUdHe sets the "ud_he" field.
|
|
func (suo *StatsUpdateOne) SetUdHe(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetUdHe()
|
|
suo.mutation.SetUdHe(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableUdHe sets the "ud_he" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableUdHe(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetUdHe(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddUdHe adds u to the "ud_he" field.
|
|
func (suo *StatsUpdateOne) AddUdHe(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddUdHe(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearUdHe clears the value of the "ud_he" field.
|
|
func (suo *StatsUpdateOne) ClearUdHe() *StatsUpdateOne {
|
|
suo.mutation.ClearUdHe()
|
|
return suo
|
|
}
|
|
|
|
// SetUdFlames sets the "ud_flames" field.
|
|
func (suo *StatsUpdateOne) SetUdFlames(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetUdFlames()
|
|
suo.mutation.SetUdFlames(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableUdFlames sets the "ud_flames" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableUdFlames(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetUdFlames(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddUdFlames adds u to the "ud_flames" field.
|
|
func (suo *StatsUpdateOne) AddUdFlames(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddUdFlames(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearUdFlames clears the value of the "ud_flames" field.
|
|
func (suo *StatsUpdateOne) ClearUdFlames() *StatsUpdateOne {
|
|
suo.mutation.ClearUdFlames()
|
|
return suo
|
|
}
|
|
|
|
// SetUdFlash sets the "ud_flash" field.
|
|
func (suo *StatsUpdateOne) SetUdFlash(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetUdFlash()
|
|
suo.mutation.SetUdFlash(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableUdFlash sets the "ud_flash" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableUdFlash(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetUdFlash(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddUdFlash adds u to the "ud_flash" field.
|
|
func (suo *StatsUpdateOne) AddUdFlash(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddUdFlash(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearUdFlash clears the value of the "ud_flash" field.
|
|
func (suo *StatsUpdateOne) ClearUdFlash() *StatsUpdateOne {
|
|
suo.mutation.ClearUdFlash()
|
|
return suo
|
|
}
|
|
|
|
// SetUdDecoy sets the "ud_decoy" field.
|
|
func (suo *StatsUpdateOne) SetUdDecoy(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetUdDecoy()
|
|
suo.mutation.SetUdDecoy(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableUdDecoy sets the "ud_decoy" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableUdDecoy(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetUdDecoy(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddUdDecoy adds u to the "ud_decoy" field.
|
|
func (suo *StatsUpdateOne) AddUdDecoy(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddUdDecoy(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearUdDecoy clears the value of the "ud_decoy" field.
|
|
func (suo *StatsUpdateOne) ClearUdDecoy() *StatsUpdateOne {
|
|
suo.mutation.ClearUdDecoy()
|
|
return suo
|
|
}
|
|
|
|
// SetUdSmoke sets the "ud_smoke" field.
|
|
func (suo *StatsUpdateOne) SetUdSmoke(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetUdSmoke()
|
|
suo.mutation.SetUdSmoke(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableUdSmoke sets the "ud_smoke" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableUdSmoke(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetUdSmoke(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddUdSmoke adds u to the "ud_smoke" field.
|
|
func (suo *StatsUpdateOne) AddUdSmoke(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddUdSmoke(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearUdSmoke clears the value of the "ud_smoke" field.
|
|
func (suo *StatsUpdateOne) ClearUdSmoke() *StatsUpdateOne {
|
|
suo.mutation.ClearUdSmoke()
|
|
return suo
|
|
}
|
|
|
|
// SetCrosshair sets the "crosshair" field.
|
|
func (suo *StatsUpdateOne) SetCrosshair(s string) *StatsUpdateOne {
|
|
suo.mutation.SetCrosshair(s)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableCrosshair sets the "crosshair" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableCrosshair(s *string) *StatsUpdateOne {
|
|
if s != nil {
|
|
suo.SetCrosshair(*s)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// ClearCrosshair clears the value of the "crosshair" field.
|
|
func (suo *StatsUpdateOne) ClearCrosshair() *StatsUpdateOne {
|
|
suo.mutation.ClearCrosshair()
|
|
return suo
|
|
}
|
|
|
|
// SetColor sets the "color" field.
|
|
func (suo *StatsUpdateOne) SetColor(s stats.Color) *StatsUpdateOne {
|
|
suo.mutation.SetColor(s)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableColor sets the "color" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableColor(s *stats.Color) *StatsUpdateOne {
|
|
if s != nil {
|
|
suo.SetColor(*s)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// ClearColor clears the value of the "color" field.
|
|
func (suo *StatsUpdateOne) ClearColor() *StatsUpdateOne {
|
|
suo.mutation.ClearColor()
|
|
return suo
|
|
}
|
|
|
|
// SetKast sets the "kast" field.
|
|
func (suo *StatsUpdateOne) SetKast(i int) *StatsUpdateOne {
|
|
suo.mutation.ResetKast()
|
|
suo.mutation.SetKast(i)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableKast sets the "kast" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableKast(i *int) *StatsUpdateOne {
|
|
if i != nil {
|
|
suo.SetKast(*i)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddKast adds i to the "kast" field.
|
|
func (suo *StatsUpdateOne) AddKast(i int) *StatsUpdateOne {
|
|
suo.mutation.AddKast(i)
|
|
return suo
|
|
}
|
|
|
|
// ClearKast clears the value of the "kast" field.
|
|
func (suo *StatsUpdateOne) ClearKast() *StatsUpdateOne {
|
|
suo.mutation.ClearKast()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashDurationSelf sets the "flash_duration_self" field.
|
|
func (suo *StatsUpdateOne) SetFlashDurationSelf(f float32) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashDurationSelf()
|
|
suo.mutation.SetFlashDurationSelf(f)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashDurationSelf sets the "flash_duration_self" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashDurationSelf(f *float32) *StatsUpdateOne {
|
|
if f != nil {
|
|
suo.SetFlashDurationSelf(*f)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashDurationSelf adds f to the "flash_duration_self" field.
|
|
func (suo *StatsUpdateOne) AddFlashDurationSelf(f float32) *StatsUpdateOne {
|
|
suo.mutation.AddFlashDurationSelf(f)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashDurationSelf clears the value of the "flash_duration_self" field.
|
|
func (suo *StatsUpdateOne) ClearFlashDurationSelf() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashDurationSelf()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashDurationTeam sets the "flash_duration_team" field.
|
|
func (suo *StatsUpdateOne) SetFlashDurationTeam(f float32) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashDurationTeam()
|
|
suo.mutation.SetFlashDurationTeam(f)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashDurationTeam sets the "flash_duration_team" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashDurationTeam(f *float32) *StatsUpdateOne {
|
|
if f != nil {
|
|
suo.SetFlashDurationTeam(*f)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashDurationTeam adds f to the "flash_duration_team" field.
|
|
func (suo *StatsUpdateOne) AddFlashDurationTeam(f float32) *StatsUpdateOne {
|
|
suo.mutation.AddFlashDurationTeam(f)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashDurationTeam clears the value of the "flash_duration_team" field.
|
|
func (suo *StatsUpdateOne) ClearFlashDurationTeam() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashDurationTeam()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashDurationEnemy sets the "flash_duration_enemy" field.
|
|
func (suo *StatsUpdateOne) SetFlashDurationEnemy(f float32) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashDurationEnemy()
|
|
suo.mutation.SetFlashDurationEnemy(f)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashDurationEnemy sets the "flash_duration_enemy" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashDurationEnemy(f *float32) *StatsUpdateOne {
|
|
if f != nil {
|
|
suo.SetFlashDurationEnemy(*f)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashDurationEnemy adds f to the "flash_duration_enemy" field.
|
|
func (suo *StatsUpdateOne) AddFlashDurationEnemy(f float32) *StatsUpdateOne {
|
|
suo.mutation.AddFlashDurationEnemy(f)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashDurationEnemy clears the value of the "flash_duration_enemy" field.
|
|
func (suo *StatsUpdateOne) ClearFlashDurationEnemy() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashDurationEnemy()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashTotalSelf sets the "flash_total_self" field.
|
|
func (suo *StatsUpdateOne) SetFlashTotalSelf(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashTotalSelf()
|
|
suo.mutation.SetFlashTotalSelf(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashTotalSelf sets the "flash_total_self" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashTotalSelf(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetFlashTotalSelf(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashTotalSelf adds u to the "flash_total_self" field.
|
|
func (suo *StatsUpdateOne) AddFlashTotalSelf(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddFlashTotalSelf(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashTotalSelf clears the value of the "flash_total_self" field.
|
|
func (suo *StatsUpdateOne) ClearFlashTotalSelf() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashTotalSelf()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashTotalTeam sets the "flash_total_team" field.
|
|
func (suo *StatsUpdateOne) SetFlashTotalTeam(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashTotalTeam()
|
|
suo.mutation.SetFlashTotalTeam(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashTotalTeam sets the "flash_total_team" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashTotalTeam(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetFlashTotalTeam(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashTotalTeam adds u to the "flash_total_team" field.
|
|
func (suo *StatsUpdateOne) AddFlashTotalTeam(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddFlashTotalTeam(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashTotalTeam clears the value of the "flash_total_team" field.
|
|
func (suo *StatsUpdateOne) ClearFlashTotalTeam() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashTotalTeam()
|
|
return suo
|
|
}
|
|
|
|
// SetFlashTotalEnemy sets the "flash_total_enemy" field.
|
|
func (suo *StatsUpdateOne) SetFlashTotalEnemy(u uint) *StatsUpdateOne {
|
|
suo.mutation.ResetFlashTotalEnemy()
|
|
suo.mutation.SetFlashTotalEnemy(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableFlashTotalEnemy sets the "flash_total_enemy" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableFlashTotalEnemy(u *uint) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetFlashTotalEnemy(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// AddFlashTotalEnemy adds u to the "flash_total_enemy" field.
|
|
func (suo *StatsUpdateOne) AddFlashTotalEnemy(u uint) *StatsUpdateOne {
|
|
suo.mutation.AddFlashTotalEnemy(u)
|
|
return suo
|
|
}
|
|
|
|
// ClearFlashTotalEnemy clears the value of the "flash_total_enemy" field.
|
|
func (suo *StatsUpdateOne) ClearFlashTotalEnemy() *StatsUpdateOne {
|
|
suo.mutation.ClearFlashTotalEnemy()
|
|
return suo
|
|
}
|
|
|
|
// SetMatchStats sets the "match_stats" field.
|
|
func (suo *StatsUpdateOne) SetMatchStats(u uint64) *StatsUpdateOne {
|
|
suo.mutation.SetMatchStats(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMatchStats sets the "match_stats" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMatchStats(u *uint64) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetMatchStats(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// ClearMatchStats clears the value of the "match_stats" field.
|
|
func (suo *StatsUpdateOne) ClearMatchStats() *StatsUpdateOne {
|
|
suo.mutation.ClearMatchStats()
|
|
return suo
|
|
}
|
|
|
|
// SetPlayerStats sets the "player_stats" field.
|
|
func (suo *StatsUpdateOne) SetPlayerStats(u uint64) *StatsUpdateOne {
|
|
suo.mutation.SetPlayerStats(u)
|
|
return suo
|
|
}
|
|
|
|
// SetNillablePlayerStats sets the "player_stats" field if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillablePlayerStats(u *uint64) *StatsUpdateOne {
|
|
if u != nil {
|
|
suo.SetPlayerStats(*u)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// ClearPlayerStats clears the value of the "player_stats" field.
|
|
func (suo *StatsUpdateOne) ClearPlayerStats() *StatsUpdateOne {
|
|
suo.mutation.ClearPlayerStats()
|
|
return suo
|
|
}
|
|
|
|
// SetMatchesID sets the "matches" edge to the Match entity by ID.
|
|
func (suo *StatsUpdateOne) SetMatchesID(id uint64) *StatsUpdateOne {
|
|
suo.mutation.SetMatchesID(id)
|
|
return suo
|
|
}
|
|
|
|
// SetNillableMatchesID sets the "matches" edge to the Match entity by ID if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillableMatchesID(id *uint64) *StatsUpdateOne {
|
|
if id != nil {
|
|
suo = suo.SetMatchesID(*id)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// SetMatches sets the "matches" edge to the Match entity.
|
|
func (suo *StatsUpdateOne) SetMatches(m *Match) *StatsUpdateOne {
|
|
return suo.SetMatchesID(m.ID)
|
|
}
|
|
|
|
// SetPlayersID sets the "players" edge to the Player entity by ID.
|
|
func (suo *StatsUpdateOne) SetPlayersID(id uint64) *StatsUpdateOne {
|
|
suo.mutation.SetPlayersID(id)
|
|
return suo
|
|
}
|
|
|
|
// SetNillablePlayersID sets the "players" edge to the Player entity by ID if the given value is not nil.
|
|
func (suo *StatsUpdateOne) SetNillablePlayersID(id *uint64) *StatsUpdateOne {
|
|
if id != nil {
|
|
suo = suo.SetPlayersID(*id)
|
|
}
|
|
return suo
|
|
}
|
|
|
|
// SetPlayers sets the "players" edge to the Player entity.
|
|
func (suo *StatsUpdateOne) SetPlayers(p *Player) *StatsUpdateOne {
|
|
return suo.SetPlayersID(p.ID)
|
|
}
|
|
|
|
// AddWeaponStatIDs adds the "weapon_stats" edge to the WeaponStats entity by IDs.
|
|
func (suo *StatsUpdateOne) AddWeaponStatIDs(ids ...int) *StatsUpdateOne {
|
|
suo.mutation.AddWeaponStatIDs(ids...)
|
|
return suo
|
|
}
|
|
|
|
// AddWeaponStats adds the "weapon_stats" edges to the WeaponStats entity.
|
|
func (suo *StatsUpdateOne) AddWeaponStats(w ...*WeaponStats) *StatsUpdateOne {
|
|
ids := make([]int, len(w))
|
|
for i := range w {
|
|
ids[i] = w[i].ID
|
|
}
|
|
return suo.AddWeaponStatIDs(ids...)
|
|
}
|
|
|
|
// AddRoundStatIDs adds the "round_stats" edge to the RoundStats entity by IDs.
|
|
func (suo *StatsUpdateOne) AddRoundStatIDs(ids ...int) *StatsUpdateOne {
|
|
suo.mutation.AddRoundStatIDs(ids...)
|
|
return suo
|
|
}
|
|
|
|
// AddRoundStats adds the "round_stats" edges to the RoundStats entity.
|
|
func (suo *StatsUpdateOne) AddRoundStats(r ...*RoundStats) *StatsUpdateOne {
|
|
ids := make([]int, len(r))
|
|
for i := range r {
|
|
ids[i] = r[i].ID
|
|
}
|
|
return suo.AddRoundStatIDs(ids...)
|
|
}
|
|
|
|
// Mutation returns the StatsMutation object of the builder.
|
|
func (suo *StatsUpdateOne) Mutation() *StatsMutation {
|
|
return suo.mutation
|
|
}
|
|
|
|
// ClearMatches clears the "matches" edge to the Match entity.
|
|
func (suo *StatsUpdateOne) ClearMatches() *StatsUpdateOne {
|
|
suo.mutation.ClearMatches()
|
|
return suo
|
|
}
|
|
|
|
// ClearPlayers clears the "players" edge to the Player entity.
|
|
func (suo *StatsUpdateOne) ClearPlayers() *StatsUpdateOne {
|
|
suo.mutation.ClearPlayers()
|
|
return suo
|
|
}
|
|
|
|
// ClearWeaponStats clears all "weapon_stats" edges to the WeaponStats entity.
|
|
func (suo *StatsUpdateOne) ClearWeaponStats() *StatsUpdateOne {
|
|
suo.mutation.ClearWeaponStats()
|
|
return suo
|
|
}
|
|
|
|
// RemoveWeaponStatIDs removes the "weapon_stats" edge to WeaponStats entities by IDs.
|
|
func (suo *StatsUpdateOne) RemoveWeaponStatIDs(ids ...int) *StatsUpdateOne {
|
|
suo.mutation.RemoveWeaponStatIDs(ids...)
|
|
return suo
|
|
}
|
|
|
|
// RemoveWeaponStats removes "weapon_stats" edges to WeaponStats entities.
|
|
func (suo *StatsUpdateOne) RemoveWeaponStats(w ...*WeaponStats) *StatsUpdateOne {
|
|
ids := make([]int, len(w))
|
|
for i := range w {
|
|
ids[i] = w[i].ID
|
|
}
|
|
return suo.RemoveWeaponStatIDs(ids...)
|
|
}
|
|
|
|
// ClearRoundStats clears all "round_stats" edges to the RoundStats entity.
|
|
func (suo *StatsUpdateOne) ClearRoundStats() *StatsUpdateOne {
|
|
suo.mutation.ClearRoundStats()
|
|
return suo
|
|
}
|
|
|
|
// RemoveRoundStatIDs removes the "round_stats" edge to RoundStats entities by IDs.
|
|
func (suo *StatsUpdateOne) RemoveRoundStatIDs(ids ...int) *StatsUpdateOne {
|
|
suo.mutation.RemoveRoundStatIDs(ids...)
|
|
return suo
|
|
}
|
|
|
|
// RemoveRoundStats removes "round_stats" edges to RoundStats entities.
|
|
func (suo *StatsUpdateOne) RemoveRoundStats(r ...*RoundStats) *StatsUpdateOne {
|
|
ids := make([]int, len(r))
|
|
for i := range r {
|
|
ids[i] = r[i].ID
|
|
}
|
|
return suo.RemoveRoundStatIDs(ids...)
|
|
}
|
|
|
|
// Select allows selecting one or more fields (columns) of the returned entity.
|
|
// The default is selecting all fields defined in the entity schema.
|
|
func (suo *StatsUpdateOne) Select(field string, fields ...string) *StatsUpdateOne {
|
|
suo.fields = append([]string{field}, fields...)
|
|
return suo
|
|
}
|
|
|
|
// Save executes the query and returns the updated Stats entity.
|
|
func (suo *StatsUpdateOne) Save(ctx context.Context) (*Stats, error) {
|
|
var (
|
|
err error
|
|
node *Stats
|
|
)
|
|
if len(suo.hooks) == 0 {
|
|
if err = suo.check(); err != nil {
|
|
return nil, err
|
|
}
|
|
node, err = suo.sqlSave(ctx)
|
|
} else {
|
|
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
|
mutation, ok := m.(*StatsMutation)
|
|
if !ok {
|
|
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
|
}
|
|
if err = suo.check(); err != nil {
|
|
return nil, err
|
|
}
|
|
suo.mutation = mutation
|
|
node, err = suo.sqlSave(ctx)
|
|
mutation.done = true
|
|
return node, err
|
|
})
|
|
for i := len(suo.hooks) - 1; i >= 0; i-- {
|
|
if suo.hooks[i] == nil {
|
|
return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
|
|
}
|
|
mut = suo.hooks[i](mut)
|
|
}
|
|
if _, err := mut.Mutate(ctx, suo.mutation); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return node, err
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (suo *StatsUpdateOne) SaveX(ctx context.Context) *Stats {
|
|
node, err := suo.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return node
|
|
}
|
|
|
|
// Exec executes the query on the entity.
|
|
func (suo *StatsUpdateOne) Exec(ctx context.Context) error {
|
|
_, err := suo.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (suo *StatsUpdateOne) ExecX(ctx context.Context) {
|
|
if err := suo.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (suo *StatsUpdateOne) check() error {
|
|
if v, ok := suo.mutation.Color(); ok {
|
|
if err := stats.ColorValidator(v); err != nil {
|
|
return &ValidationError{Name: "color", err: fmt.Errorf("ent: validator failed for field \"color\": %w", err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (suo *StatsUpdateOne) sqlSave(ctx context.Context) (_node *Stats, err error) {
|
|
_spec := &sqlgraph.UpdateSpec{
|
|
Node: &sqlgraph.NodeSpec{
|
|
Table: stats.Table,
|
|
Columns: stats.Columns,
|
|
ID: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
id, ok := suo.mutation.ID()
|
|
if !ok {
|
|
return nil, &ValidationError{Name: "ID", err: fmt.Errorf("missing Stats.ID for update")}
|
|
}
|
|
_spec.Node.ID.Value = id
|
|
if fields := suo.fields; len(fields) > 0 {
|
|
_spec.Node.Columns = make([]string, 0, len(fields))
|
|
_spec.Node.Columns = append(_spec.Node.Columns, stats.FieldID)
|
|
for _, f := range fields {
|
|
if !stats.ValidColumn(f) {
|
|
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
|
}
|
|
if f != stats.FieldID {
|
|
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
|
}
|
|
}
|
|
}
|
|
if ps := suo.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := suo.mutation.TeamID(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldTeamID,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedTeamID(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldTeamID,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Kills(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKills,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedKills(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKills,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Deaths(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldDeaths,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedDeaths(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldDeaths,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Assists(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldAssists,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedAssists(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldAssists,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Headshot(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldHeadshot,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedHeadshot(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldHeadshot,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Mvp(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMvp,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedMvp(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMvp,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Score(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldScore,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedScore(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldScore,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.RankNew(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedRankNew(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if suo.mutation.RankNewCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldRankNew,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.RankOld(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedRankOld(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if suo.mutation.RankOldCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldRankOld,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Mk2(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedMk2(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if suo.mutation.Mk2Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk2,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Mk3(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedMk3(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if suo.mutation.Mk3Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk3,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Mk4(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedMk4(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if suo.mutation.Mk4Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk4,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Mk5(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedMk5(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if suo.mutation.Mk5Cleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldMk5,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.DmgEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedDmgEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if suo.mutation.DmgEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldDmgEnemy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.DmgTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedDmgTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if suo.mutation.DmgTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldDmgTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.UdHe(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedUdHe(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if suo.mutation.UdHeCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdHe,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.UdFlames(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedUdFlames(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if suo.mutation.UdFlamesCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdFlames,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.UdFlash(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedUdFlash(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if suo.mutation.UdFlashCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdFlash,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.UdDecoy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedUdDecoy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if suo.mutation.UdDecoyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdDecoy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.UdSmoke(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedUdSmoke(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if suo.mutation.UdSmokeCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldUdSmoke,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Crosshair(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeString,
|
|
Value: value,
|
|
Column: stats.FieldCrosshair,
|
|
})
|
|
}
|
|
if suo.mutation.CrosshairCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeString,
|
|
Column: stats.FieldCrosshair,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Color(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeEnum,
|
|
Value: value,
|
|
Column: stats.FieldColor,
|
|
})
|
|
}
|
|
if suo.mutation.ColorCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeEnum,
|
|
Column: stats.FieldColor,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.Kast(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedKast(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Value: value,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if suo.mutation.KastCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: stats.FieldKast,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashDurationSelf(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashDurationSelf(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if suo.mutation.FlashDurationSelfCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationSelf,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashDurationTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashDurationTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if suo.mutation.FlashDurationTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashDurationEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashDurationEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Value: value,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if suo.mutation.FlashDurationEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeFloat32,
|
|
Column: stats.FieldFlashDurationEnemy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashTotalSelf(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashTotalSelf(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if suo.mutation.FlashTotalSelfCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalSelf,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashTotalTeam(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashTotalTeam(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if suo.mutation.FlashTotalTeamCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalTeam,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.FlashTotalEnemy(); ok {
|
|
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if value, ok := suo.mutation.AddedFlashTotalEnemy(); ok {
|
|
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Value: value,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if suo.mutation.FlashTotalEnemyCleared() {
|
|
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint,
|
|
Column: stats.FieldFlashTotalEnemy,
|
|
})
|
|
}
|
|
if suo.mutation.MatchesCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.MatchesTable,
|
|
Columns: []string{stats.MatchesColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: match.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.MatchesIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.MatchesTable,
|
|
Columns: []string{stats.MatchesColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: match.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if suo.mutation.PlayersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.PlayersTable,
|
|
Columns: []string{stats.PlayersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: player.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.PlayersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: stats.PlayersTable,
|
|
Columns: []string{stats.PlayersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeUint64,
|
|
Column: player.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if suo.mutation.WeaponStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.RemovedWeaponStatsIDs(); len(nodes) > 0 && !suo.mutation.WeaponStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.WeaponStatsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.WeaponStatsTable,
|
|
Columns: []string{stats.WeaponStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: weaponstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if suo.mutation.RoundStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.RemovedRoundStatsIDs(); len(nodes) > 0 && !suo.mutation.RoundStatsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := suo.mutation.RoundStatsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: stats.RoundStatsTable,
|
|
Columns: []string{stats.RoundStatsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: &sqlgraph.FieldSpec{
|
|
Type: field.TypeInt,
|
|
Column: roundstats.FieldID,
|
|
},
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
_node = &Stats{config: suo.config}
|
|
_spec.Assign = _node.assignValues
|
|
_spec.ScanValues = _node.scanValues
|
|
if err = sqlgraph.UpdateNode(ctx, suo.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{stats.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{err.Error(), err}
|
|
}
|
|
return nil, err
|
|
}
|
|
return _node, nil
|
|
}
|