Documentation
¶
Index ¶
- type Game
- type GameService
- func (s *GameService) CloseGames(notifs []NewGameNotification)
- func (s *GameService) CloseNewGameCh(playerID string)
- func (s *GameService) ListenAny(notifs []NewGameNotification, ctx context.Context) <-chan int
- func (s *GameService) NewGame(playerX string, playerO string) error
- func (s *GameService) OpenGamesForPlayer(playerUUID string) ([]NewGameNotification, <-chan NewGameNotification, error)
- type GameState
- type GridState
- type NewGameNotification
- type Player
- type SquareState
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameService ¶
type GameService struct {
*Store
// contains filtered or unexported fields
}
func NewGameService ¶
func NewGameService(dbFilename string) (*GameService, error)
func (*GameService) CloseGames ¶
func (s *GameService) CloseGames(notifs []NewGameNotification)
func (*GameService) CloseNewGameCh ¶
func (s *GameService) CloseNewGameCh(playerID string)
func (*GameService) ListenAny ¶
func (s *GameService) ListenAny(notifs []NewGameNotification, ctx context.Context) <-chan int
func (*GameService) OpenGamesForPlayer ¶
func (s *GameService) OpenGamesForPlayer(playerUUID string) ([]NewGameNotification, <-chan NewGameNotification, error)
type GridState ¶
type GridState struct {
Owner *string `json:"owner"`
Squares [3][3]SquareState `json:"squares"`
}
type NewGameNotification ¶
type NewGameNotification struct {
Game *Game
UpdateCh <-chan struct{}
}
type SquareState ¶
type SquareState struct {
Owner *string `json:"owner"`
Playable bool `json:"playable"`
Coordinate game.Coordinate `json:"coordinate"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreatePlayer ¶
Click to show internal directories.
Click to hide internal directories.