Documentation
¶
Index ¶
- Constants
- Variables
- func GetBoardID(whi botsfw.WebhookInput, boardID string) (string, error)
- func LeaveTournamentAction(whc botsfw.WebhookContext, prizarenaGameID, prizarenaToken string, ...) (err error)
- func NextRound(board Board)
- type Board
- type BoardEntity
- type BoardEntityBase
- type BoardUsersManagers
- type CellAddress
- type PlayEntity
- type SingleTurnPlay
- type SingleTurnPlayEntity
- type Size
- type Transcript
Constants ¶
View Source
const BoardKind = "B"
View Source
const LeaveTournamentCommandCode = "leave-tournament"
Variables ¶
View Source
var ( ErrOldRound = errors.New("old round") ErrUnknownRound = errors.New("unknown round") )
Functions ¶
func GetBoardID ¶
func GetBoardID(whi botsfw.WebhookInput, boardID string) (string, error)
func LeaveTournamentAction ¶
Types ¶
type BoardEntity ¶
type BoardEntityBase ¶
type BoardEntityBase struct {
Created time.Time
CreatorUserID string `datastore:",noindex,omitempty"`
UserIDs []string
UserNames []string `datastore:",noindex"`
UserWins []int `datastore:",noindex"`
UsersMin int `datastore:",noindex,omitempty"`
UsersMax int `datastore:",noindex,omitempty"`
Round int `datastore:",noindex,omitempty"`
Lang string `datastore:",noindex,omitempty"`
TournamentID string `datastore:",omitempty"`
TournamentJson string `datastore:",noindex,omitempty"`
}
func (*BoardEntityBase) AddUser ¶
func (v *BoardEntityBase) AddUser(userID, userName string)
func (BoardEntityBase) GetUserName ¶
func (v BoardEntityBase) GetUserName(userID string) string
func (BoardEntityBase) IsNewUser ¶
func (v BoardEntityBase) IsNewUser(userID string) bool
type BoardUsersManagers ¶
type BoardUsersManagers struct {
// contains filtered or unexported fields
}
func (BoardUsersManagers) AddUserToBoard ¶
func (m BoardUsersManagers) AddUserToBoard( c context.Context, userID, userName string, boardBase BoardEntityBase, getAppUser func() (botsfw.BotAppUser, error), ) (userName2 string, boardBase2 BoardEntityBase, err error)
type CellAddress ¶
type CellAddress string
CellAddress is coded as "CharDigit" where Char is X and Digit is Y, e.g. A1, B2, C3, etc.
func NewCellAddress ¶
func NewCellAddress(x, y int) CellAddress
func (CellAddress) Index ¶
func (ca CellAddress) Index(boardSize int) int
func (CellAddress) IsXY ¶
func (ca CellAddress) IsXY(x, y int) bool
func (CellAddress) X ¶
func (ca CellAddress) X() int
func (CellAddress) XY ¶
func (ca CellAddress) XY() (x, y int)
func (CellAddress) Y ¶
func (ca CellAddress) Y() int
type PlayEntity ¶
type SingleTurnPlay ¶
type SingleTurnPlay struct {
record.WithID[string]
*SingleTurnPlayEntity
}
type SingleTurnPlayEntity ¶
type SingleTurnPlayEntity struct {
PlayEntity
UserMoves []string
}
type Transcript ¶
type Transcript string
func (Transcript) Cells ¶
func (t Transcript) Cells() (cells []CellAddress)
func (Transcript) Count ¶
func (t Transcript) Count() int
Click to show internal directories.
Click to hide internal directories.