Documentation ¶
Index ¶
Constants ¶
View Source
const BotActivityName = "play"
Variables ¶
View Source
var ChessNotation = chess.UCINotation{}
Functions ¶
This section is empty.
Types ¶
type BotActivity ¶
type BotActivity struct {
// contains filtered or unexported fields
}
func NewBotActivity ¶
func NewBotActivity(bot *Bot) *BotActivity
type Color ¶
Color is a wrap of chess.Color with JSON-encoding compatibility.
func (Color) MarshalJSON ¶
func (*Color) UnmarshalJSON ¶
type GameInfo ¶
type GameInfo struct { FEN string // Position of the board. Outcome chess.Outcome // Result of the game ("*" means "in progress"). Method chess.Method // Method that generated the outcome. Board string // Simple viz of the board using Unicode chess symbols. Turn Turn // Current turn. Color Color // User's color. ValidMoves []string // Valid moves when it is the user's turn. }
GameInfo is the data structure that this workflow is going to return from query handlers or as the final return value describing the state of the game
func GameWorkflow ¶
func GameWorkflow(ctx workflow.Context, params GameWorkflowParams) (*GameInfo, error)
GameWorkflow is the game workflow function.
type GameWorkflowParams ¶
type GameWorkflowParams struct { Color Color `json:"color"` // Color chosen by the user, leave empty for a random pick. FEN string `json:"fen"` // Initial state of the game in Forsysth-Edwards notation. }
func (*GameWorkflowParams) PickColor ¶
func (params *GameWorkflowParams) PickColor(ctx workflow.Context)
type Turn ¶
type Turn uint8
Turn of the game.
func (Turn) MarshalJSON ¶
func (*Turn) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.