game

package
v0.0.0-...-42846c8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BingoWonResponse

type BingoWonResponse struct {
	Board *Board
}

type Board

type Board struct {
	FieldTexts [][]string
	Ticked     [][]uint8
}

func NewBoard

func NewBoard(fields [][]string) (*Board, error)

func (*Board) IsBingo

func (board *Board) IsBingo() bool

func (*Board) Mark

func (board *Board) Mark(pos int) (bool, error)

type Command

type Command struct {
	Cmd         string
	Description string
}

type Controller

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

func NewController

func NewController(repo GameRepository) *Controller

func (*Controller) ProcessMessage

func (ctrl *Controller) ProcessMessage(gameID, message string) (interface{}, error)

type Game

type Game struct {
	ID    string
	Texts []string
	Board *Board
}

func NewGame

func NewGame(ID string) *Game

func (*Game) AddText

func (g *Game) AddText(text string) error

func (*Game) NewBoard

func (g *Game) NewBoard() error

func (*Game) RemoveText

func (g *Game) RemoveText(pos int) error

type GameRepository

type GameRepository interface {
	Persist(*Game) error
	Get(ID string) (*Game, error)
}

type HelpResponse

type HelpResponse struct {
	Commands    []Command
	ContactPage string
}

type ListTextsResponse

type ListTextsResponse struct {
	Texts []string
}

type ShowBoardResponse

type ShowBoardResponse struct {
	Board *Board
}

type TextMessage

type TextMessage struct {
	Text string
}

Jump to

Keyboard shortcuts

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