engine source pure
Package engine is the deterministic battle core of Cage Match. Two fighters trade actions on a small grid; the same t...
Package engine is the deterministic battle core of Cage Match. Two fighters trade actions on a small grid; the same two fighters always produce the same recap, so any recorded fight can be replayed and verified by anyone, on or off chain.
3
1
9
type Action
structAction is one round's decision. Dir is used by Move and Attack.
type ActionKind
identActionKind is what a fighter does in a round.
type Dir
identDir is a cardinal direction.
type Fighter
interfaceFighter is a battle program. Step must be deterministic.
type FighterState
structFighterState is the public state of one fighter.
type Frame
structFrame is one resolved round of a fight.
type Pos
structPos is a tile on the grid. (0,0) is the top-left corner.
type Recap
structRecap is the full record of a fight. Winner is 0 for A, 1 for B, -1 draw.
type View
structView is what a fighter sees at the start of a round.
Imports 0
Imports nothing.