Documentation ¶
Index ¶
- type Notifier
- type Player
- type Question
- type QuestionResult
- type Room
- func (r *Room) AdvanceToNextQuestion()
- func (r *Room) AnswerQuestion(playerKey string, guess types.Coordinate) (int, error)
- func (r *Room) CanBeAdvanced() bool
- func (r *Room) Close() error
- func (r *Room) ConfigErrors() []string
- func (r *Room) Creation() time.Time
- func (r *Room) FindPlayer(key string) (*Player, bool)
- func (r *Room) Finished() bool
- func (r *Room) HasActiveQuestion(playerKey string) bool
- func (r *Room) Join(name string) Player
- func (r *Room) Key() string
- func (r *Room) Kick(target string, initiator string) Player
- func (r *Room) Leave(playerKey string) Player
- func (r *Room) Lock()
- func (r *Room) Options() RoomOptions
- func (r *Room) Play(playerKey string)
- func (r *Room) Players() []Player
- func (r *Room) Question() (string, int)
- func (r *Room) SetOptions(options RoomOptions, playerKey string)
- func (r *Room) Started() bool
- func (r *Room) Unlock()
- type RoomOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier interface { NotifyPlayerJoined(string, string) NotifyPlayerLeft(string, string) NotifyRoomUpdated(RoomOptions, string) NotifyGameStarted(playerKey string) NotifyPlayerAnswered(string, int) NotifyQuestionCountdown(int, int) NotifyQuestion(string, int) NotifyAnswerTimeCountdown(int) NotifyQuestionResults(result QuestionResult) NotifyGameEnded(reason string, result map[string]int) NotifyPlayerKicked(string, string, string) }
type QuestionResult ¶
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func (*Room) AdvanceToNextQuestion ¶
func (r *Room) AdvanceToNextQuestion()
func (*Room) AnswerQuestion ¶
func (*Room) CanBeAdvanced ¶
func (*Room) ConfigErrors ¶
func (*Room) HasActiveQuestion ¶
func (*Room) Options ¶
func (r *Room) Options() RoomOptions
func (*Room) SetOptions ¶
func (r *Room) SetOptions(options RoomOptions, playerKey string)
type RoomOptions ¶
type RoomOptions struct { StreetList *geodata.StreetList NumberOfQuestions int MaxAnswerTime time.Duration }
func (*RoomOptions) Errors ¶
func (r *RoomOptions) Errors() []string
Click to show internal directories.
Click to hide internal directories.