tron

package
v0.0.0-...-a616d5f Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DirectionLeft     = direction("left")
	DirectionRight    = direction("right")
	DirectionStraight = direction("straight")
)

Functions

This section is empty.

Types

type Arena

type Arena interface {
	ProcessTurn() error
	Join(m Moto) error
	MotoCount() int
	Winner() Moto
}

func NewArena

func NewArena(size int) Arena

type Color

type Color string

func NewRandomColor

func NewRandomColor() Color

type Game

type Game interface {
	Id() Id
	Start() error
	Kill()
	Started() bool
	Finished() bool
	Arena() Arena
}

func NewGame

func NewGame(id Id, turnDuration time.Duration, a Arena) Game

type Id

type Id string

func NewRandomId

func NewRandomId() Id

type Moto

type Moto interface {
	Color() Color
	Direction() direction
	Steer(d direction)
	Crash()
	Crashed() bool
}

func NewMoto

func NewMoto(c Color) Moto

type Server

type Server interface {
	AddGame(g Game) error
	Game(id Id) (Game, bool)
	Serve() error
}

func NewServer

func NewServer() Server

type Square

type Square interface {
	X() int
	Y() int
	Colorize(c Color) error
	Color() Color
}

Jump to

Keyboard shortcuts

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