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

@@ -21,6 +21,19 @@ func (f MatchFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error
return f(ctx, mv)
}
// The MatchPlayerFunc type is an adapter to allow the use of ordinary
// function as MatchPlayer mutator.
type MatchPlayerFunc func(context.Context, *ent.MatchPlayerMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f MatchPlayerFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.MatchPlayerMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MatchPlayerMutation", m)
}
return f(ctx, mv)
}
// The PlayerFunc type is an adapter to allow the use of ordinary
// function as Player mutator.
type PlayerFunc func(context.Context, *ent.PlayerMutation) (ent.Value, error)
@@ -47,28 +60,28 @@ func (f RoundStatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
return f(ctx, mv)
}
// The StatsFunc type is an adapter to allow the use of ordinary
// function as Stats mutator.
type StatsFunc func(context.Context, *ent.StatsMutation) (ent.Value, error)
// The SprayFunc type is an adapter to allow the use of ordinary
// function as Spray mutator.
type SprayFunc func(context.Context, *ent.SprayMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f StatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.StatsMutation)
func (f SprayFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.SprayMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.StatsMutation", m)
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.SprayMutation", m)
}
return f(ctx, mv)
}
// The WeaponStatsFunc type is an adapter to allow the use of ordinary
// function as WeaponStats mutator.
type WeaponStatsFunc func(context.Context, *ent.WeaponStatsMutation) (ent.Value, error)
// The WeaponFunc type is an adapter to allow the use of ordinary
// function as Weapon mutator.
type WeaponFunc func(context.Context, *ent.WeaponMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f WeaponStatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.WeaponStatsMutation)
func (f WeaponFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.WeaponMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.WeaponStatsMutation", m)
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.WeaponMutation", m)
}
return f(ctx, mv)
}