Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board struct { Piles [13][]PositionedCard Score int32 }
Board is the current state of the board.
type Error ¶
type Error struct { Actual error Category ErrorCategory }
Error wraps an existing error and assigns it a category.
type ErrorCategory ¶
type ErrorCategory uint8
An ErrorCategory must be at least detailed enough to only correspond to a single http status code, but may be broken down further (one-to-many).
const ( SemanticError ErrorCategory MalformedError UnimplementedError NotFoundError UnknownError )
supported error categories
func (ErrorCategory) String ¶
func (i ErrorCategory) String() string
type Index ¶
type Index uint8
Index is the value part of the card.
const ( Ace Index Two Three Four Five Six Seven Eight Nine Ten Jack Queen King Juggler Fool )
Standard deck indices.
type ListGames ¶
type ListGames struct { Cursor struct { Offset int32 Limit int32 } Games []SavedGameSummary }
ListGames lists running games.
type ListGamesCaller ¶
ListGamesCaller is a list game command.
type Move ¶
type Move struct { OldPileNum int OldPileIndex int OldPilePosition Position NewPileNum int NewPileIndex int NewPilePosition Position }
Move is a transformation of the board.
type PerformMove ¶
type PerformMove struct { Next []Move SavedGameDetail SavedGameDetail }
PerformMove executes a move on a game.
type PerformMoveCaller ¶
type PerformMoveCaller interface {
CallPerformMove(context.Context, PerformMove) (PerformMove, error)
}
PerformMoveCaller is a perform move command.
type PositionedCard ¶
PositionedCard is a card that has a position
type SavedGameDetail ¶
type SavedGameDetail struct { GameID int64 Board Board History [][]Move PossibleNextMoves [][]Move Variant Variant }
SavedGameDetail is a saved game with detail of the game state.
type SavedGameSummary ¶
SavedGameSummary is a saved game with summary of the game state.
type StartGame ¶
type StartGame struct { Variant Variant SavedGameDetail SavedGameDetail }
StartGame starts a game.
type StartGameCaller ¶
StartGameCaller is a start game command.