bot

package
v0.0.0-...-7c4a433 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlayGame

func PlayGame(c Client, b Bot, line string)

Types

type Bot

type Bot interface {
	NewGame(g *Game)
	GameOver()
	GetMove(ctx context.Context,
		p *tak.Position,
		mine, theirs time.Duration) tak.Move
	AcceptUndo() bool
	HandleChat(who, msg string)
}

type Client

type Client interface {
	Recv() <-chan string
	SendCommand(...string)
}

type Game

type Game struct {
	ID       string
	GameStr  string
	Opponent string
	Color    tak.Color
	Size     int
	Time     time.Duration

	Positions []*tak.Position
	// contains filtered or unexported fields
}

func (*Game) MyTime

func (g *Game) MyTime() time.Duration

Jump to

Keyboard shortcuts

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