Documentation ¶
Index ¶
- func AddGameToPlayer(db memory.Memory, gameID int64, playerID int64) error
- func AddGameToPlayers(db memory.Memory, gameID int64, playersID ...int64) (err error)
- func AssertPlayer(t testing.TB, got, want Player)
- func Cmd(db memory.Memory, cmd, text string, p int64, ChatID int64) (r pb.Response, err error)
- func CurrentGame(id int64, db memory.Memory) (gameID int64, err error)
- func Do(id int64, db memory.Memory, move string, chatID int64) (pb.Response, error)
- func Move(gameID, playerID int64, text string) (err error)
- func NewMessage(p int64, chatID int64, cmd, text string, db memory.Memory) (r pb.Response, err error)
- type NoConnectionError
- type NoGamesError
- type NoSuchCommandError
- type NoSuchPlayerError
- type NoUsernameInDatabaseError
- type Player
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGameToPlayer ¶
add new game to a player by id
func AddGameToPlayers ¶
Add new game
func AssertPlayer ¶
func CurrentGame ¶
returns current game
Types ¶
type NoConnectionError ¶
type NoConnectionError struct{}
func (NoConnectionError) Error ¶
func (n NoConnectionError) Error() string
type NoGamesError ¶
type NoGamesError struct{}
func (NoGamesError) Error ¶
func (n NoGamesError) Error() string
type NoSuchCommandError ¶
type NoSuchCommandError struct {
// contains filtered or unexported fields
}
func (NoSuchCommandError) Error ¶
func (n NoSuchCommandError) Error() string
type NoSuchPlayerError ¶
type NoSuchPlayerError struct {
ID int64
}
func (NoSuchPlayerError) Error ¶
func (n NoSuchPlayerError) Error() string
type NoUsernameInDatabaseError ¶
type NoUsernameInDatabaseError struct{}
func (NoUsernameInDatabaseError) Error ¶
func (n NoUsernameInDatabaseError) Error() string
type Player ¶
type Player struct { ID int64 GamesID []int64 `json:"gamesID"` Username string `json:"username"` Rating int64 }
func MakePlayer ¶
get or create new player
func (*Player) AddNewGame ¶
func (*Player) CurrentGame ¶
Click to show internal directories.
Click to hide internal directories.