Documentation
¶
Index ¶
- Constants
- Variables
- func HandleStart(w http.ResponseWriter, r *http.Request)
- func IsGameComplete() bool
- func ProcessGame(id int64)
- func Serve()
- type Examiner
- type PlayerStateStore
- func (sb *PlayerStateStore) Add(ps *types.PlayerState) int64
- func (sb *PlayerStateStore) Broadcast(mt int, action types.Action, data interface{})
- func (sb *PlayerStateStore) BroadcastWithSkip(mt int, action types.Action, data interface{}, skip int64)
- func (sb *PlayerStateStore) CountReady() int
- func (sb *PlayerStateStore) Get(id int64) *types.PlayerState
- func (sb *PlayerStateStore) Remove(id int64)
- func (sb *PlayerStateStore) UpdateStatus(s types.ReadyState)
- func (sb *PlayerStateStore) UpdateStatusFor(id int64, s types.ReadyState)
Constants ¶
View Source
const MAX_QUEUED_PLAYERS = 128
View Source
const PORT = 5174
Variables ¶
View Source
var MyGameState = types.GameState{ Status: types.Pending, Settings: types.GameSettings{ Language: "javascript", Problem: "FizzBuzz", }, }
Functions ¶
func HandleStart ¶
func HandleStart(w http.ResponseWriter, r *http.Request)
func IsGameComplete ¶
func IsGameComplete() bool
func ProcessGame ¶
func ProcessGame(id int64)
Types ¶
type Examiner ¶
func NewExaminer ¶
func NewExaminer() Examiner
type PlayerStateStore ¶
var Players PlayerStateStore
func (*PlayerStateStore) Add ¶
func (sb *PlayerStateStore) Add(ps *types.PlayerState) int64
func (*PlayerStateStore) Broadcast ¶
func (sb *PlayerStateStore) Broadcast(mt int, action types.Action, data interface{})
func (*PlayerStateStore) BroadcastWithSkip ¶
func (sb *PlayerStateStore) BroadcastWithSkip(mt int, action types.Action, data interface{}, skip int64)
func (*PlayerStateStore) CountReady ¶
func (sb *PlayerStateStore) CountReady() int
func (*PlayerStateStore) Get ¶
func (sb *PlayerStateStore) Get(id int64) *types.PlayerState
func (*PlayerStateStore) Remove ¶
func (sb *PlayerStateStore) Remove(id int64)
func (*PlayerStateStore) UpdateStatus ¶
func (sb *PlayerStateStore) UpdateStatus(s types.ReadyState)
func (*PlayerStateStore) UpdateStatusFor ¶
func (sb *PlayerStateStore) UpdateStatusFor(id int64, s types.ReadyState)
Click to show internal directories.
Click to hide internal directories.