added spray patterns
This commit is contained in:
59
ent/weapon/weapon.go
Normal file
59
ent/weapon/weapon.go
Normal file
@@ -0,0 +1,59 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package weapon
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the weapon type in the database.
|
||||
Label = "weapon"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldVictim holds the string denoting the victim field in the database.
|
||||
FieldVictim = "victim"
|
||||
// FieldDmg holds the string denoting the dmg field in the database.
|
||||
FieldDmg = "dmg"
|
||||
// FieldEqType holds the string denoting the eq_type field in the database.
|
||||
FieldEqType = "eq_type"
|
||||
// FieldHitGroup holds the string denoting the hit_group field in the database.
|
||||
FieldHitGroup = "hit_group"
|
||||
// EdgeStat holds the string denoting the stat edge name in mutations.
|
||||
EdgeStat = "stat"
|
||||
// Table holds the table name of the weapon in the database.
|
||||
Table = "weapons"
|
||||
// StatTable is the table that holds the stat relation/edge.
|
||||
StatTable = "weapons"
|
||||
// StatInverseTable is the table name for the MatchPlayer entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "matchplayer" package.
|
||||
StatInverseTable = "match_players"
|
||||
// StatColumn is the table column denoting the stat relation/edge.
|
||||
StatColumn = "match_player_weapon_stats"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for weapon fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldVictim,
|
||||
FieldDmg,
|
||||
FieldEqType,
|
||||
FieldHitGroup,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "weapons"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"match_player_weapon_stats",
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
485
ent/weapon/where.go
Normal file
485
ent/weapon/where.go
Normal file
@@ -0,0 +1,485 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package weapon
|
||||
|
||||
import (
|
||||
"csgowtfd/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(ids) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
v := make([]interface{}, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(ids) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
v := make([]interface{}, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// Victim applies equality check predicate on the "victim" field. It's identical to VictimEQ.
|
||||
func Victim(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Dmg applies equality check predicate on the "dmg" field. It's identical to DmgEQ.
|
||||
func Dmg(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqType applies equality check predicate on the "eq_type" field. It's identical to EqTypeEQ.
|
||||
func EqType(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroup applies equality check predicate on the "hit_group" field. It's identical to HitGroupEQ.
|
||||
func HitGroup(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimEQ applies the EQ predicate on the "victim" field.
|
||||
func VictimEQ(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimNEQ applies the NEQ predicate on the "victim" field.
|
||||
func VictimNEQ(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimIn applies the In predicate on the "victim" field.
|
||||
func VictimIn(vs ...uint64) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldVictim), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimNotIn applies the NotIn predicate on the "victim" field.
|
||||
func VictimNotIn(vs ...uint64) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldVictim), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimGT applies the GT predicate on the "victim" field.
|
||||
func VictimGT(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimGTE applies the GTE predicate on the "victim" field.
|
||||
func VictimGTE(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimLT applies the LT predicate on the "victim" field.
|
||||
func VictimLT(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// VictimLTE applies the LTE predicate on the "victim" field.
|
||||
func VictimLTE(v uint64) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldVictim), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgEQ applies the EQ predicate on the "dmg" field.
|
||||
func DmgEQ(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgNEQ applies the NEQ predicate on the "dmg" field.
|
||||
func DmgNEQ(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgIn applies the In predicate on the "dmg" field.
|
||||
func DmgIn(vs ...uint) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldDmg), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgNotIn applies the NotIn predicate on the "dmg" field.
|
||||
func DmgNotIn(vs ...uint) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldDmg), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgGT applies the GT predicate on the "dmg" field.
|
||||
func DmgGT(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgGTE applies the GTE predicate on the "dmg" field.
|
||||
func DmgGTE(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgLT applies the LT predicate on the "dmg" field.
|
||||
func DmgLT(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DmgLTE applies the LTE predicate on the "dmg" field.
|
||||
func DmgLTE(v uint) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldDmg), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeEQ applies the EQ predicate on the "eq_type" field.
|
||||
func EqTypeEQ(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeNEQ applies the NEQ predicate on the "eq_type" field.
|
||||
func EqTypeNEQ(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeIn applies the In predicate on the "eq_type" field.
|
||||
func EqTypeIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldEqType), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeNotIn applies the NotIn predicate on the "eq_type" field.
|
||||
func EqTypeNotIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldEqType), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeGT applies the GT predicate on the "eq_type" field.
|
||||
func EqTypeGT(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeGTE applies the GTE predicate on the "eq_type" field.
|
||||
func EqTypeGTE(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeLT applies the LT predicate on the "eq_type" field.
|
||||
func EqTypeLT(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// EqTypeLTE applies the LTE predicate on the "eq_type" field.
|
||||
func EqTypeLTE(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldEqType), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupEQ applies the EQ predicate on the "hit_group" field.
|
||||
func HitGroupEQ(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupNEQ applies the NEQ predicate on the "hit_group" field.
|
||||
func HitGroupNEQ(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupIn applies the In predicate on the "hit_group" field.
|
||||
func HitGroupIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.In(s.C(FieldHitGroup), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupNotIn applies the NotIn predicate on the "hit_group" field.
|
||||
func HitGroupNotIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
s.Where(sql.NotIn(s.C(FieldHitGroup), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupGT applies the GT predicate on the "hit_group" field.
|
||||
func HitGroupGT(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupGTE applies the GTE predicate on the "hit_group" field.
|
||||
func HitGroupGTE(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupLT applies the LT predicate on the "hit_group" field.
|
||||
func HitGroupLT(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HitGroupLTE applies the LTE predicate on the "hit_group" field.
|
||||
func HitGroupLTE(v int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldHitGroup), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HasStat applies the HasEdge predicate on the "stat" edge.
|
||||
func HasStat() predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(StatTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, StatTable, StatColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasStatWith applies the HasEdge predicate on the "stat" edge with a given conditions (other predicates).
|
||||
func HasStatWith(preds ...predicate.MatchPlayer) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(StatInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, StatTable, StatColumn),
|
||||
)
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Weapon) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for _, p := range predicates {
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Weapon) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
s1 := s.Clone().SetP(nil)
|
||||
for i, p := range predicates {
|
||||
if i > 0 {
|
||||
s1.Or()
|
||||
}
|
||||
p(s1)
|
||||
}
|
||||
s.Where(s1.P())
|
||||
})
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Weapon) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user