added roundstats with eco info, switched to avatar hash

This commit is contained in:
2021-10-17 03:52:20 +02:00
parent 7f5a2f8956
commit fd8c026a8e
35 changed files with 4187 additions and 160 deletions

View File

@@ -34,6 +34,19 @@ func (f PlayerFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, erro
return f(ctx, mv)
}
// The RoundStatsFunc type is an adapter to allow the use of ordinary
// function as RoundStats mutator.
type RoundStatsFunc func(context.Context, *ent.RoundStatsMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f RoundStatsFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
mv, ok := m.(*ent.RoundStatsMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.RoundStatsMutation", m)
}
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)