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

@@ -42,6 +42,12 @@ type Player struct {
ProfileCreated time.Time `json:"profile_created,omitempty"`
// OldestSharecodeSeen holds the value of the "oldest_sharecode_seen" field.
OldestSharecodeSeen string `json:"oldest_sharecode_seen,omitempty"`
// Wins holds the value of the "wins" field.
Wins int `json:"wins,omitempty"`
// Looses holds the value of the "looses" field.
Looses int `json:"looses,omitempty"`
// Ties holds the value of the "ties" field.
Ties int `json:"ties,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PlayerQuery when eager-loading is set.
Edges PlayerEdges `json:"edges"`
@@ -50,7 +56,7 @@ type Player struct {
// PlayerEdges holds the relations/edges for other nodes in the graph.
type PlayerEdges struct {
// Stats holds the value of the stats edge.
Stats []*Stats `json:"stats,omitempty"`
Stats []*MatchPlayer `json:"stats,omitempty"`
// Matches holds the value of the matches edge.
Matches []*Match `json:"matches,omitempty"`
// loadedTypes holds the information for reporting if a
@@ -60,7 +66,7 @@ type PlayerEdges struct {
// StatsOrErr returns the Stats value or an error if the edge
// was not loaded in eager-loading.
func (e PlayerEdges) StatsOrErr() ([]*Stats, error) {
func (e PlayerEdges) StatsOrErr() ([]*MatchPlayer, error) {
if e.loadedTypes[0] {
return e.Stats, nil
}
@@ -81,7 +87,7 @@ func (*Player) scanValues(columns []string) ([]interface{}, error) {
values := make([]interface{}, len(columns))
for i := range columns {
switch columns[i] {
case player.FieldID, player.FieldVacCount, player.FieldGameBanCount:
case player.FieldID, player.FieldVacCount, player.FieldGameBanCount, player.FieldWins, player.FieldLooses, player.FieldTies:
values[i] = new(sql.NullInt64)
case player.FieldName, player.FieldAvatar, player.FieldVanityURL, player.FieldVanityURLReal, player.FieldAuthCode, player.FieldOldestSharecodeSeen:
values[i] = new(sql.NullString)
@@ -186,13 +192,31 @@ func (pl *Player) assignValues(columns []string, values []interface{}) error {
} else if value.Valid {
pl.OldestSharecodeSeen = value.String
}
case player.FieldWins:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field wins", values[i])
} else if value.Valid {
pl.Wins = int(value.Int64)
}
case player.FieldLooses:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field looses", values[i])
} else if value.Valid {
pl.Looses = int(value.Int64)
}
case player.FieldTies:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field ties", values[i])
} else if value.Valid {
pl.Ties = int(value.Int64)
}
}
}
return nil
}
// QueryStats queries the "stats" edge of the Player entity.
func (pl *Player) QueryStats() *StatsQuery {
func (pl *Player) QueryStats() *MatchPlayerQuery {
return (&PlayerClient{config: pl.config}).QueryStats(pl)
}
@@ -249,6 +273,12 @@ func (pl *Player) String() string {
builder.WriteString(pl.ProfileCreated.Format(time.ANSIC))
builder.WriteString(", oldest_sharecode_seen=")
builder.WriteString(pl.OldestSharecodeSeen)
builder.WriteString(", wins=")
builder.WriteString(fmt.Sprintf("%v", pl.Wins))
builder.WriteString(", looses=")
builder.WriteString(fmt.Sprintf("%v", pl.Looses))
builder.WriteString(", ties=")
builder.WriteString(fmt.Sprintf("%v", pl.Ties))
builder.WriteByte(')')
return builder.String()
}