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