Documentation ¶
Index ¶
- func New(ctx context.Context, ad *ActionDispatcher, rs *RouterStore, opt Options) error
- type ActionDispatcher
- func (ac *ActionDispatcher) Dispatch(a *action.Action)
- func (ac *ActionDispatcher) ExitWaitingRoom(un string)
- func (ac *ActionDispatcher) GoHome()
- func (ac *ActionDispatcher) JoinWaitingRoom(un string)
- func (ac *ActionDispatcher) NavigateTo(route string)
- func (ac *ActionDispatcher) SignUpSubmit(un string)
- func (ac *ActionDispatcher) WindowResizing(w, h int)
- type Game
- type LobbyState
- type LobbyStore
- type Options
- type RouterState
- type RouterStore
- type SignUpState
- type SignUpStore
- type Store
- type UserState
- type UserStore
- type WaitingRoomState
- type WaitingRoomStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, ad *ActionDispatcher, rs *RouterStore, opt Options) error
Types ¶
type ActionDispatcher ¶
type ActionDispatcher struct {
// contains filtered or unexported fields
}
ActionDispatcher is in charge of dispatching actions to the application dispatcher
func NewActionDispatcher ¶
func NewActionDispatcher(d *flux.Dispatcher, s *store.Store, l *slog.Logger, opt Options) *ActionDispatcher
NewActionDispatcher initializes the action dispatcher with the give dispatcher
func (*ActionDispatcher) Dispatch ¶
func (ac *ActionDispatcher) Dispatch(a *action.Action)
Dispatch is a helper to access to the internal dispatch directly with an action. This should only be used from the WS Handler to forward server actions directly
func (*ActionDispatcher) ExitWaitingRoom ¶
func (ac *ActionDispatcher) ExitWaitingRoom(un string)
func (*ActionDispatcher) GoHome ¶
func (ac *ActionDispatcher) GoHome()
GoHome will move the camera to the current player home line
func (*ActionDispatcher) JoinWaitingRoom ¶
func (ac *ActionDispatcher) JoinWaitingRoom(un string)
func (*ActionDispatcher) NavigateTo ¶
func (ac *ActionDispatcher) NavigateTo(route string)
NavigateTo navigates to the given route
func (*ActionDispatcher) SignUpSubmit ¶
func (ac *ActionDispatcher) SignUpSubmit(un string)
func (*ActionDispatcher) WindowResizing ¶
func (ac *ActionDispatcher) WindowResizing(w, h int)
WindowResizing new sizes of the window
type Game ¶
Game is the main struct that is the initializer of the main loop. It holds all the other Stores and the Map
type LobbyState ¶
type LobbyState struct {
TotalUsers int
}
type LobbyStore ¶
type LobbyStore struct { *flux.ReduceStore Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewLobbyStore ¶
func NewLobbyStore(d *flux.Dispatcher, s *Store, l *slog.Logger) (*LobbyStore, error)
func (*LobbyStore) Draw ¶
func (ls *LobbyStore) Draw(screen *ebiten.Image)
func (*LobbyStore) Reduce ¶
func (ls *LobbyStore) Reduce(state, a interface{}) interface{}
func (*LobbyStore) Update ¶
func (ls *LobbyStore) Update() error
type RouterState ¶
type RouterState struct {
Route string
}
type RouterStore ¶
type RouterStore struct { *flux.ReduceStore // contains filtered or unexported fields }
func NewRouterStore ¶
func NewRouterStore(d *flux.Dispatcher, su *SignUpStore, ls *LobbyStore, wr *WaitingRoomStore, g *Game, l *slog.Logger) *RouterStore
func (*RouterStore) Draw ¶
func (rs *RouterStore) Draw(screen *ebiten.Image)
func (*RouterStore) Layout ¶
func (rs *RouterStore) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
func (*RouterStore) Reduce ¶
func (rs *RouterStore) Reduce(state, a interface{}) interface{}
func (*RouterStore) Update ¶
func (rs *RouterStore) Update() error
type SignUpState ¶
type SignUpState struct {
Error string
}
type SignUpStore ¶
type SignUpStore struct { *flux.ReduceStore Store *store.Store Logger *slog.Logger // contains filtered or unexported fields }
func NewSignUpStore ¶
func (*SignUpStore) Draw ¶
func (su *SignUpStore) Draw(screen *ebiten.Image)
func (*SignUpStore) Reduce ¶
func (su *SignUpStore) Reduce(state, a interface{}) interface{}
func (*SignUpStore) Update ¶
func (su *SignUpStore) Update() error
type UserStore ¶
type UserStore struct {
*flux.ReduceStore
}
func NewUserStore ¶
func NewUserStore(d *flux.Dispatcher) *UserStore
type WaitingRoomState ¶
type WaitingRoomStore ¶
type WaitingRoomStore struct { *flux.ReduceStore Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewWaitingRoomStore ¶
func NewWaitingRoomStore(d *flux.Dispatcher, s *Store, l *slog.Logger) *WaitingRoomStore
func (*WaitingRoomStore) Draw ¶
func (wr *WaitingRoomStore) Draw(screen *ebiten.Image)
func (*WaitingRoomStore) Reduce ¶
func (wr *WaitingRoomStore) Reduce(state, a interface{}) interface{}
func (*WaitingRoomStore) Update ¶
func (wr *WaitingRoomStore) Update() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.