Game
typeGame is a match between First and Second. First plays turn 1. It is pending until Second accepts, and only then are players named in events that notify them.
Value
v0.Game
games
v0.Tree// id → \*Game
- OID
- 07dd49…5ac2:4
games details
lastGame
v0.IDValue
<zero>
declared
boolValue
true
load
func(id string) *v0.Game- OID
- 07dd49…5ac2:7
load details
NewGame
func(opponent .uverse.address) stringNewGame invites opponent to a game and returns its id. The caller plays first once opponent accepts.
- OID
- 07dd49…5ac2:9
NewGame details
Accept
func(game string)Accept starts a pending game. Only the invited player may call it.
- OID
- 07dd49…5ac2:10
Accept details
Play
func(game string)Play takes the caller's turn in game and passes it to the other player.
- OID
- 07dd49…5ac2:11
Play details
Leave
func(game string)Leave cancels a pending game or ends a started one, and deletes it.
- OID
- 07dd49…5ac2:12
Leave details
DeclareTriggers
func()DeclareTriggers declares the "your turn" trigger in the gnotif registry. The registry sees this realm as the caller, so the trigger is verified.
- OID
- 07dd49…5ac2:13
DeclareTriggers details
pageSize
untyped bigintValue
(50 <untyped> bigint)
Render
func(path string) stringRender serves "" (the first page), "page/N" and "game/\<id>".
- OID
- 07dd49…5ac2:14
Render details
renderPage
func(n int) stringrenderPage lists the games newest first, pageSize to a page.
- OID
- 07dd49…5ac2:16
renderPage details
renderGame
func(g *v0.Game) string- OID
- 07dd49…5ac2:17
renderGame details
status
func(g *v0.Game) string- OID
- 07dd49…5ac2:18
status details
selfPath
stringselfPath is this realm's path on gnoweb. It is read at package init, where the realm itself is current; Render is not crossing, so reading it there would give the caller's path. It only builds links.
Value
"/r/g13rqvks880v0hmlfepcj0kkudq0js38d3pc5k6a/pingpong/v0"