Help us shape the future of Go! Take the 2026 Go Developer Survey

arena

package
v0.31.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package arena ships the stateful arena actions for the Flow Arena example.

Index

Constants

View Source
const (
	ID = "arena"
)

Variables

This section is empty.

Functions

func Bundle

func Bundle(_ map[string]string) compiler.Bundle

Types

type CountRes

type CountRes struct {
	Players int `json:"players"`
}

type InputReq

type InputReq struct {
	ID string `json:"id" validate:"required"`
	DX int    `json:"dx"`
	DY int    `json:"dy"`
}

type InputRes

type InputRes struct {
	OK bool `json:"ok"`
}

type Player

type Player struct {
	ID string `json:"id"`
	X  int    `json:"x"`
	Y  int    `json:"y"`
}

type SpawnReq

type SpawnReq struct {
	ID string `json:"id" validate:"required"`
}

type SpawnRes

type SpawnRes struct {
	OK bool `json:"ok"`
	X  int  `json:"x"`
	Y  int  `json:"y"`
}

type TickRes

type TickRes struct {
	Tick uint64 `json:"tick"`
}

type View

type View struct {
	Tick   uint64   `json:"tick"`
	Self   Player   `json:"self"`
	Nearby []Player `json:"nearby"`
}

type ViewReq

type ViewReq struct {
	ID     string `json:"id"     validate:"required"`
	Radius int    `json:"radius"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL