Documentation
¶
Index ¶
Constants ¶
View Source
const ( Heartbeat EventType = "heartbeat" Registration = "registration" EventRound = "round" EventShot = "shot" )
Variables ¶
View Source
var ( ErrGameNotStarted = fmt.Errorf("game not gameStarted yet") ErrGameAlreadyStarted = fmt.Errorf("game already started") ErrInvalidPayload = fmt.Errorf("invalid payload") ErrGameFinished = fmt.Errorf("game is over") ErrInvalidPlayerRegistration = fmt.Errorf("invalid player registration event") )
Various error messages
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Type EventType `json:"type"` Data json.RawMessage `json:"data,omitempty"` }
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func NewGame ¶
func NewGame(cfg *domain.MasterConfig) *Game
func (*Game) HandleEvent ¶
HandleEvent processes incoming events and updates the game state accordingly.
Click to show internal directories.
Click to hide internal directories.