added spray patterns

This commit is contained in:
2021-10-31 08:40:02 +01:00
parent 268793f0e5
commit 978232dd0a
66 changed files with 16805 additions and 11903 deletions

View File

@@ -5,8 +5,8 @@ package ent
import (
"context"
"csgowtfd/ent/match"
"csgowtfd/ent/matchplayer"
"csgowtfd/ent/player"
"csgowtfd/ent/stats"
"errors"
"fmt"
"time"
@@ -204,23 +204,65 @@ func (pc *PlayerCreate) SetNillableOldestSharecodeSeen(s *string) *PlayerCreate
return pc
}
// SetWins sets the "wins" field.
func (pc *PlayerCreate) SetWins(i int) *PlayerCreate {
pc.mutation.SetWins(i)
return pc
}
// SetNillableWins sets the "wins" field if the given value is not nil.
func (pc *PlayerCreate) SetNillableWins(i *int) *PlayerCreate {
if i != nil {
pc.SetWins(*i)
}
return pc
}
// SetLooses sets the "looses" field.
func (pc *PlayerCreate) SetLooses(i int) *PlayerCreate {
pc.mutation.SetLooses(i)
return pc
}
// SetNillableLooses sets the "looses" field if the given value is not nil.
func (pc *PlayerCreate) SetNillableLooses(i *int) *PlayerCreate {
if i != nil {
pc.SetLooses(*i)
}
return pc
}
// SetTies sets the "ties" field.
func (pc *PlayerCreate) SetTies(i int) *PlayerCreate {
pc.mutation.SetTies(i)
return pc
}
// SetNillableTies sets the "ties" field if the given value is not nil.
func (pc *PlayerCreate) SetNillableTies(i *int) *PlayerCreate {
if i != nil {
pc.SetTies(*i)
}
return pc
}
// SetID sets the "id" field.
func (pc *PlayerCreate) SetID(u uint64) *PlayerCreate {
pc.mutation.SetID(u)
return pc
}
// AddStatIDs adds the "stats" edge to the Stats entity by IDs.
// AddStatIDs adds the "stats" edge to the MatchPlayer entity by IDs.
func (pc *PlayerCreate) AddStatIDs(ids ...int) *PlayerCreate {
pc.mutation.AddStatIDs(ids...)
return pc
}
// AddStats adds the "stats" edges to the Stats entity.
func (pc *PlayerCreate) AddStats(s ...*Stats) *PlayerCreate {
ids := make([]int, len(s))
for i := range s {
ids[i] = s[i].ID
// AddStats adds the "stats" edges to the MatchPlayer entity.
func (pc *PlayerCreate) AddStats(m ...*MatchPlayer) *PlayerCreate {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return pc.AddStatIDs(ids...)
}
@@ -459,6 +501,30 @@ func (pc *PlayerCreate) createSpec() (*Player, *sqlgraph.CreateSpec) {
})
_node.OldestSharecodeSeen = value
}
if value, ok := pc.mutation.Wins(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: player.FieldWins,
})
_node.Wins = value
}
if value, ok := pc.mutation.Looses(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: player.FieldLooses,
})
_node.Looses = value
}
if value, ok := pc.mutation.Ties(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: player.FieldTies,
})
_node.Ties = value
}
if nodes := pc.mutation.StatsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -469,7 +535,7 @@ func (pc *PlayerCreate) createSpec() (*Player, *sqlgraph.CreateSpec) {
Target: &sqlgraph.EdgeTarget{
IDSpec: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: stats.FieldID,
Column: matchplayer.FieldID,
},
},
}