Documentation
¶
Index ¶
- type Context
- type Game
- func (g *Game) Active() bool
- func (g *Game) OnBroadcast(c Context, ev event.Broadcast) error
- func (g *Game) OnDisconnect(c Context) error
- func (g *Game) OnFinishGame(c Context, ev event.FinishGame) error
- func (g *Game) OnFinishGameApprove(c Context, ev event.FinishGameApprove) error
- func (g *Game) OnFinishGameReject(c Context, ev event.FinishGameReject) error
- func (g *Game) OnJoinGame(c Context) error
- func (g *Game) OnLocationUpdate(c Context, ev event.LocationUpdate) error
- func (g *Game) OnPause(c Context, ev event.Pause) error
- func (g *Game) OnPlayerCatch(c Context, ev event.PlayerCatch) error
- func (g *Game) OnPlayerCatchApprove(c Context, ev event.PlayerCatchApprove) error
- func (g *Game) OnPlayerCatchReject(c Context, ev event.PlayerCatchReject) error
- func (g *Game) OnSetRoute(c Context, ev event.SetRoute) error
- func (g *Game) OnStartGame(c Context, _ event.StartGame) error
- func (g *Game) OnTaskApprove(c Context, ev event.TaskApprove) error
- func (g *Game) OnTaskComplete(c Context, ev event.TaskComplete) error
- func (g *Game) OnTaskReject(c Context, ev event.TaskReject) error
- func (g *Game) OnUnpause(c Context, _ event.Unpause) error
- type Handler
- func (h *Handler) Handle(c Context, e state.AnyEvent) error
- func (h *Handler) OnAuth(c Context, ev event.Auth) error
- func (h *Handler) OnConnect(c Context) error
- func (h *Handler) OnDisconnect(c Context) error
- func (h *Handler) OnJoinGame(c Context, ev event.JoinGame) error
- func (h *Handler) OnLeaveGame(c Context, _ event.LeaveGame) error
- func (h *Handler) RegisteredEvents() []string
- type InMemoryGameRepo
- type Middleware
- type PlayerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context = *state.Context[*PlayerState]
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) OnDisconnect ¶
func (*Game) OnFinishGame ¶
func (g *Game) OnFinishGame(c Context, ev event.FinishGame) error
func (*Game) OnFinishGameApprove ¶
func (g *Game) OnFinishGameApprove(c Context, ev event.FinishGameApprove) error
func (*Game) OnFinishGameReject ¶
func (g *Game) OnFinishGameReject(c Context, ev event.FinishGameReject) error
func (*Game) OnJoinGame ¶
func (*Game) OnLocationUpdate ¶
func (g *Game) OnLocationUpdate(c Context, ev event.LocationUpdate) error
func (*Game) OnPlayerCatch ¶
func (g *Game) OnPlayerCatch(c Context, ev event.PlayerCatch) error
func (*Game) OnPlayerCatchApprove ¶
func (g *Game) OnPlayerCatchApprove(c Context, ev event.PlayerCatchApprove) error
func (*Game) OnPlayerCatchReject ¶
func (g *Game) OnPlayerCatchReject(c Context, ev event.PlayerCatchReject) error
func (*Game) OnTaskApprove ¶
func (g *Game) OnTaskApprove(c Context, ev event.TaskApprove) error
func (*Game) OnTaskComplete ¶
func (g *Game) OnTaskComplete(c Context, ev event.TaskComplete) error
func (*Game) OnTaskReject ¶
func (g *Game) OnTaskReject(c Context, ev event.TaskReject) error
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) OnDisconnect ¶
func (*Handler) RegisteredEvents ¶
type InMemoryGameRepo ¶
type InMemoryGameRepo struct {
// contains filtered or unexported fields
}
func NewInMemoryGameRepo ¶
func (*InMemoryGameRepo) DeleteGame ¶
func (r *InMemoryGameRepo) DeleteGame(ctx context.Context, id string) error
type Middleware ¶
type Middleware = state.MiddlewareFunc[*PlayerState, *PlayerState, state.AnyEvent, state.AnyEvent]
Click to show internal directories.
Click to hide internal directories.