Documentation ¶
Index ¶
- Constants
- Variables
- type Game
- func (g *Game) End() error
- func (g *Game) Get(playerID ID) (*Player, error)
- func (g *Game) HandleSubmission(playerID ID, name string) error
- func (g *Game) IsHost(playerID ID) bool
- func (g *Game) Join(playerID ID) error
- func (g *Game) Marshal() (*string, error)
- func (g *Game) Next() (*string, bool)
- func (g *Game) Slog() func()
- func (g *Game) Unseen() int
- type Games
- type ID
- type Player
Constants ¶
View Source
const IDLength int = 7 // 3 runes 1 dash 3 runes
Variables ¶
View Source
var ( ErrGameOver = errors.New("game already over") ErrUserAlreadySubmitted = errors.New("user already submitted") )
View Source
var ErrInvalidID = errors.New("invalid ID")
View Source
var GAMES = NewGames()
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { ID ID `json:"id"` HostID ID `json:"host_id"` IsActive bool `json:"is_active"` Players map[ID]Player `json:"players"` }
func UnmarshalGame ¶
Click to show internal directories.
Click to hide internal directories.