Documentation ¶
Index ¶
- func CreatePacket(command string, v any) []byte
- type Answer
- type Competitor
- type GameState
- type Leaderboard
- type Lobbies
- type Lobby
- func (l *Lobby) AddPlayer(p *Player)
- func (l *Lobby) BroadcastToAllPlayers(m []byte)
- func (l *Lobby) CreateLeaderboard() Leaderboard
- func (l *Lobby) GenerateQuiz(length int) []Question
- func (l *Lobby) GenerateQuizSongs(length int) ([]spotify.FullTrack, []spotify.FullTrack)
- func (l *Lobby) HasPlayer(p *Player) bool
- func (l *Lobby) RemovePlayer(p *Player)
- type Packet
- type Player
- type Question
- type ScoreEntry
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePacket ¶
Types ¶
type Competitor ¶
type Leaderboard ¶
type Leaderboard struct {
Scores []ScoreEntry `json:"scores"`
}
type Lobbies ¶
type Lobbies struct {
// contains filtered or unexported fields
}
func (*Lobbies) RemoveLobby ¶
type Lobby ¶
type Lobby struct { Host string `json:"-"` LobbyId string `json:"lobbyId"` PlayerList []*Player `json:"players"` Points map[string]int `json:"points"` State GameState `json:"-"` Guesses map[string]int `json:"-"` // Index Questions []Question `json:"-"` Round int `json:"-"` Timer *time.Timer `json:"-"` // contains filtered or unexported fields }
func (*Lobby) BroadcastToAllPlayers ¶
func (*Lobby) CreateLeaderboard ¶
func (l *Lobby) CreateLeaderboard() Leaderboard
func (*Lobby) GenerateQuiz ¶
ONLY CALL THIS ONCE SPOTIFY API SLOW
func (*Lobby) GenerateQuizSongs ¶
func (*Lobby) RemovePlayer ¶
type ScoreEntry ¶
Click to show internal directories.
Click to hide internal directories.