runner

package
v0.0.0-...-02e2d4b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBaseContext

func WithBaseContext(ctx context.Context) option

func WithBoardSize

func WithBoardSize(rows, columns int) option

func WithClockInterval

func WithClockInterval(interval time.Duration) option

func WithCloseGracePeriod

func WithCloseGracePeriod(duration time.Duration) option

func WithInitBoard

func WithInitBoard(initBoard *board.Board) option

func WithInitFn

func WithInitFn(fn func(point board.Point) bool) option

func WithListener

func WithListener(listener chan<- *board.Board) option

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func New

func New(optionFns ...option) (*Runner, error)

func (*Runner) AddListener

func (g *Runner) AddListener(l chan<- *board.Board)

func (*Runner) BoardSize

func (g *Runner) BoardSize() (int, int)

func (*Runner) ClockInterval

func (g *Runner) ClockInterval() time.Duration

func (*Runner) Close

func (g *Runner) Close() error

Close closes the

func (*Runner) LoopError

func (g *Runner) LoopError() error

func (*Runner) RemoveListener

func (g *Runner) RemoveListener(l chan<- *board.Board)

func (*Runner) Start

func (g *Runner) Start() error

Start starts the Runner clock. This function is Idempotent so calling it after the engine started does nothing.

type State

type State uint32
const (
	Stopped State = iota
	Starting
	Running
	Stopping
	Errored
)

func (State) String

func (i State) String() string

Jump to

Keyboard shortcuts

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