runner

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseChallengeRule

func ParseChallengeRule(rule string) (pb.ChallengeRule, error)

func ShowChallengeRule

func ShowChallengeRule(rule pb.ChallengeRule) string

Types

type GameOptions

type GameOptions struct {
	Lexicon         *Lexicon
	ChallengeRule   pb.ChallengeRule
	FirstIsAssigned bool
	GoesFirst       int
	BoardLayoutName string
}

func (*GameOptions) SetBoardLayoutName

func (opts *GameOptions) SetBoardLayoutName(name string) error

func (*GameOptions) SetChallenge

func (opts *GameOptions) SetChallenge(rule string) error

func (*GameOptions) SetDefaults

func (opts *GameOptions) SetDefaults(config *config.Config)

func (*GameOptions) SetLexicon

func (opts *GameOptions) SetLexicon(fields []string) error

type GameRunner

type GameRunner struct {
	game.Game
}

func NewGameRunnerFromRules

func NewGameRunnerFromRules(opts *GameOptions, players []*pb.PlayerInfo, rules *game.GameRules) (*GameRunner, error)

NewGameRunnerFromRules is a good entry point

func (*GameRunner) IsPlaying

func (g *GameRunner) IsPlaying() bool

func (*GameRunner) MoveFromEvent

func (g *GameRunner) MoveFromEvent(evt *pb.GameEvent) (*move.Move, error)

func (*GameRunner) NewChallengeMove

func (g *GameRunner) NewChallengeMove(playerid int) (*move.Move, error)

func (*GameRunner) NewExchangeMove

func (g *GameRunner) NewExchangeMove(playerid int, letters string) (*move.Move, error)

func (*GameRunner) NewPassMove

func (g *GameRunner) NewPassMove(playerid int) (*move.Move, error)

func (*GameRunner) NewPlacementMove

func (g *GameRunner) NewPlacementMove(playerid int, coords string, word string) (*move.Move, error)

func (*GameRunner) ParseMove

func (g *GameRunner) ParseMove(playerid int, lowercase bool, fields []string) (*move.Move, error)

func (*GameRunner) SetCurrentRack

func (g *GameRunner) SetCurrentRack(letters string) error

func (*GameRunner) SetPlayerRack

func (g *GameRunner) SetPlayerRack(playerid int, letters string) error

type Lexicon

type Lexicon struct {
	Name         string
	Distribution string
}

func (*Lexicon) ToDisplayString

func (lex *Lexicon) ToDisplayString() string

Jump to

Keyboard shortcuts

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