30 lines
536 B
Go
30 lines
536 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/edge"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// Weapon holds the schema definition for the Weapon entity.
|
|
type Weapon struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the Weapon.
|
|
func (Weapon) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Uint64("victim"),
|
|
field.Uint("dmg"),
|
|
field.Int("eq_type"),
|
|
field.Int("hit_group"),
|
|
}
|
|
}
|
|
|
|
// Edges of the Weapon.
|
|
func (Weapon) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.From("stat", MatchPlayer.Type).Ref("weapon_stats").Unique(),
|
|
}
|
|
}
|