Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

report.gno

0.61 Kb · 16 lines
 1package arena
 2
 3import (
 4	"gno.land/p/nym-gfanton001/gnomepit/engine/v0"
 5	"gno.land/r/nym-gfanton001/gnomepit/standings/v0"
 6)
 7
 8// report sends match m, which has just ended, to the standings realm to be rated. A match
 9// its challenger accepted is not reported. Neither is any match while the arena is off the
10// writer list, where Record would abort the ending.
11func report(cur realm, rules *engine.Ruleset, m record) {
12	if m.challenger == m.acceptor || !standings.IsWriter(self) {
13		return
14	}
15	standings.Record(cross(cur), m.challenger, m.acceptor, clanName(rules, m.clans[0]), clanName(rules, m.clans[1]), m.result)
16}