added detailed parsing of player hurt events

This commit is contained in:
2021-10-11 21:37:10 +02:00
parent 3ff65bc5d7
commit 4b7851da83
28 changed files with 14660 additions and 978 deletions

View File

@@ -47,6 +47,19 @@ func (f StatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error
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)
// Mutate calls f(ctx, m).
func (f WeaponStatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.WeaponStatsMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.WeaponStatsMutation", m)
}
return f(ctx, mv)
}
// Condition is a hook condition function.
type Condition func(context.Context, ent.Mutation) bool