Documentation ¶
Index ¶
- func New(ctx context.Context, ad *ActionDispatcher, rs *RouterStore, opt Options) error
- type ActionDispatcher
- func (ac *ActionDispatcher) CheckVersion()
- func (ac *ActionDispatcher) CreateLobby(lid, o, ln string, lmp int)
- func (ac *ActionDispatcher) DeleteLobby(lid string)
- func (ac *ActionDispatcher) Dispatch(a *action.Action)
- func (ac *ActionDispatcher) ExitVs1WaitingRoom(un string)
- func (ac *ActionDispatcher) ExitVs6WaitingRoom(un string)
- func (ac *ActionDispatcher) GoHome()
- func (ac *ActionDispatcher) JoinLobby(lid, un string, ib bool)
- func (ac *ActionDispatcher) JoinVs1WaitingRoom(un string)
- func (ac *ActionDispatcher) JoinVs6WaitingRoom(un string)
- func (ac *ActionDispatcher) LeaveLobby(lid, un string)
- func (ac *ActionDispatcher) NavigateTo(route string)
- func (ac *ActionDispatcher) RefreshLobbies()
- func (ac *ActionDispatcher) SelectLobby(lid string)
- func (ac *ActionDispatcher) SignUpSubmit(un string)
- func (ac *ActionDispatcher) StartLobby(lid string)
- func (ac *ActionDispatcher) WindowResizing(w, h int)
- type Game
- type LobbiesView
- type NewLobbyView
- type Options
- type RootState
- type RootStore
- type RouterState
- type RouterStore
- type ShowLobbyView
- type SignUpState
- type SignUpStore
- type Store
- type UserState
- type UserStore
- type Vs1WaitingRoomState
- type Vs1WaitingRoomStore
- type Vs6WaitingRoomState
- type Vs6WaitingRoomStore
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) CheckVersion ¶ added in v1.1.0
func (ac *ActionDispatcher) CheckVersion()
func (*ActionDispatcher) CreateLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) CreateLobby(lid, o, ln string, lmp int)
func (*ActionDispatcher) DeleteLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) DeleteLobby(lid string)
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) ExitVs1WaitingRoom ¶ added in v1.2.0
func (ac *ActionDispatcher) ExitVs1WaitingRoom(un string)
func (*ActionDispatcher) ExitVs6WaitingRoom ¶ added in v1.2.0
func (ac *ActionDispatcher) ExitVs6WaitingRoom(un string)
func (*ActionDispatcher) GoHome ¶
func (ac *ActionDispatcher) GoHome()
GoHome will move the camera to the current player home line
func (*ActionDispatcher) JoinLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) JoinLobby(lid, un string, ib bool)
func (*ActionDispatcher) JoinVs1WaitingRoom ¶ added in v1.2.0
func (ac *ActionDispatcher) JoinVs1WaitingRoom(un string)
func (*ActionDispatcher) JoinVs6WaitingRoom ¶ added in v1.2.0
func (ac *ActionDispatcher) JoinVs6WaitingRoom(un string)
func (*ActionDispatcher) LeaveLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) LeaveLobby(lid, un string)
func (*ActionDispatcher) NavigateTo ¶
func (ac *ActionDispatcher) NavigateTo(route string)
NavigateTo navigates to the given route
func (*ActionDispatcher) RefreshLobbies ¶ added in v1.1.0
func (ac *ActionDispatcher) RefreshLobbies()
func (*ActionDispatcher) SelectLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) SelectLobby(lid string)
func (*ActionDispatcher) SignUpSubmit ¶
func (ac *ActionDispatcher) SignUpSubmit(un string)
func (*ActionDispatcher) StartLobby ¶ added in v1.1.0
func (ac *ActionDispatcher) StartLobby(lid 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 LobbiesView ¶ added in v1.1.0
type LobbiesView struct { Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewLobbiesView ¶ added in v1.1.0
func NewLobbiesView(s *Store, l *slog.Logger) *LobbiesView
func (*LobbiesView) Draw ¶ added in v1.1.0
func (lv *LobbiesView) Draw(screen *ebiten.Image)
func (*LobbiesView) Update ¶ added in v1.1.0
func (lv *LobbiesView) Update() error
type NewLobbyView ¶ added in v1.1.0
type NewLobbyView struct { Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewNewLobbyView ¶ added in v1.1.0
func NewNewLobbyView(s *Store, l *slog.Logger) *NewLobbyView
func (*NewLobbyView) Draw ¶ added in v1.1.0
func (nl *NewLobbyView) Draw(screen *ebiten.Image)
func (*NewLobbyView) Update ¶ added in v1.1.0
func (nl *NewLobbyView) Update() error
type RootStore ¶ added in v1.1.0
type RootStore struct { *flux.ReduceStore Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewRootStore ¶ added in v1.1.0
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, ros *RootStore, wr6 *Vs6WaitingRoomStore, wr1 *Vs1WaitingRoomStore, g *Game, lv *LobbiesView, nlv *NewLobbyView, slv *ShowLobbyView, 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 ShowLobbyView ¶ added in v1.1.0
type ShowLobbyView struct { Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewShowLobbyView ¶ added in v1.1.0
func NewShowLobbyView(s *Store, l *slog.Logger) *ShowLobbyView
func (*ShowLobbyView) Draw ¶ added in v1.1.0
func (sl *ShowLobbyView) Draw(screen *ebiten.Image)
func (*ShowLobbyView) Update ¶ added in v1.1.0
func (sl *ShowLobbyView) Update() error
type SignUpState ¶
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 Vs1WaitingRoomState ¶ added in v1.2.0
type Vs1WaitingRoomStore ¶ added in v1.2.0
type Vs1WaitingRoomStore struct { *flux.ReduceStore Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewVs1WaitingRoomStore ¶ added in v1.2.0
func NewVs1WaitingRoomStore(d *flux.Dispatcher, s *Store, l *slog.Logger) *Vs1WaitingRoomStore
func (*Vs1WaitingRoomStore) Draw ¶ added in v1.2.0
func (wr *Vs1WaitingRoomStore) Draw(screen *ebiten.Image)
func (*Vs1WaitingRoomStore) Reduce ¶ added in v1.2.0
func (wr *Vs1WaitingRoomStore) Reduce(state, a interface{}) interface{}
func (*Vs1WaitingRoomStore) Update ¶ added in v1.2.0
func (wr *Vs1WaitingRoomStore) Update() error
type Vs6WaitingRoomState ¶ added in v1.2.0
type Vs6WaitingRoomStore ¶ added in v1.2.0
type Vs6WaitingRoomStore struct { *flux.ReduceStore Store *Store Logger *slog.Logger // contains filtered or unexported fields }
func NewVs6WaitingRoomStore ¶ added in v1.2.0
func NewVs6WaitingRoomStore(d *flux.Dispatcher, s *Store, l *slog.Logger) *Vs6WaitingRoomStore
func (*Vs6WaitingRoomStore) Draw ¶ added in v1.2.0
func (wr *Vs6WaitingRoomStore) Draw(screen *ebiten.Image)
func (*Vs6WaitingRoomStore) Reduce ¶ added in v1.2.0
func (wr *Vs6WaitingRoomStore) Reduce(state, a interface{}) interface{}
func (*Vs6WaitingRoomStore) Update ¶ added in v1.2.0
func (wr *Vs6WaitingRoomStore) Update() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.