Documentation ¶
Index ¶
- func TypeStrings() []string
- type Action
- func NewAddPlayer(id, name string, lid int) *Action
- func NewCameraZoom(d int) *Action
- func NewChangeUnitLine(uid string) *Action
- func NewCloseTowerMenu() *Action
- func NewCursorMove(x, y int) *Action
- func NewDeselectTower(_ string) *Action
- func NewExitWaitingRoom(un string) *Action
- func NewGoHome() *Action
- func NewIncomeTick() *Action
- func NewJoinWaitingRoom(un string) *Action
- func NewNavigateTo(route string) *Action
- func NewOpenTowerMenu(tid string) *Action
- func NewPlaceTower(t, pid string, x, y int) *Action
- func NewRemovePlayer(id string) *Action
- func NewRemoveTower(pid, tid, tt string) *Action
- func NewRemoveUnit(uid string) *Action
- func NewSelectTower(t string, x, y int) *Action
- func NewSelectedTowerInvalid(i bool) *Action
- func NewSignUpError(e string) *Action
- func NewStartGame() *Action
- func NewStealLive(fpid, tpid string) *Action
- func NewSummonUnit(t, pid string, plid, clid int) *Action
- func NewSyncState(players *SyncStatePlayersPayload, lines *SyncStateLinesPayload) *Action
- func NewSyncUsers(totalUsers int) *Action
- func NewSyncWaitingRoom(tp, s, cd int) *Action
- func NewTPS(t time.Time) *Action
- func NewToggleStats() *Action
- func NewTowerAttack(uid, tt string) *Action
- func NewUnitKilled(pid, ut string) *Action
- func NewUserSignIn(un string) *Action
- func NewUserSignOut(un string) *Action
- func NewUserSignUp(un string) *Action
- func NewWaitRoomCountdownTick() *Action
- func NewWindowResizing(w, h int) *Action
- type AddPlayerPayload
- type CameraZoomPayload
- type ChangeUnitLinePayload
- type CloseTowerMenuPayload
- type CursorMovePayload
- type ExitWaitingRoomPayload
- type GoHomePayload
- type JoinWaitingRoomPayload
- type NavigateToPayload
- type OpenTowerMenuPayload
- type PlaceTowerPayload
- type RemovePlayerPayload
- type RemoveTowerPayload
- type RemoveUnitPayload
- type SelectTowerPayload
- type SelectedTowerInvalidPayload
- type SignUpErrorPayload
- type StartGamePayload
- type StealLivePayload
- type SummonUnitPayload
- type SyncStateLinePayload
- type SyncStateLinesPayload
- type SyncStatePayload
- type SyncStatePlayerPayload
- type SyncStatePlayersPayload
- type SyncStateTowerPayload
- type SyncStateUnitPayload
- type SyncUsersPayload
- type SyncWaitingRoomPayload
- type TPSPayload
- type ToggleStatsPayload
- type TowerAttackPayload
- type Type
- type UnitKilledPayload
- type UserSignInPayload
- type UserSignOutPayload
- type UserSignUpPayload
- type WindowResizingPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TypeStrings ¶
func TypeStrings() []string
TypeStrings returns a slice of all String values of the enum
Types ¶
type Action ¶
type Action struct { Type Type `json:"type"` Room string `json:"room"` CursorMove *CursorMovePayload `json:"cursor_move,omitempty"` SummonUnit *SummonUnitPayload `json:"summon_unit,omitempty"` RemoveUnit *RemoveUnitPayload `json:"remove_unit,omitempty"` ChangeUnitLine *ChangeUnitLinePayload `json:"change_unit_line,omitempty"` StealLive *StealLivePayload `json:"steal_live,omitempty"` CameraZoom *CameraZoomPayload `json:"camera_zoom,omitempty"` SelectTower *SelectTowerPayload `json:"select_tower,omitempty"` PlaceTower *PlaceTowerPayload `json:"place_tower,omitempty"` RemoveTower *RemoveTowerPayload `json:"remove_tower,omitempty"` SelectedTowerInvalid *SelectedTowerInvalidPayload `json:"selected_tower_invalid,omitempty"` TowerAttack *TowerAttackPayload `json:"tower_attack,omitempty"` UnitKilled *UnitKilledPayload `json:"unit_killed,omitempty"` WindowResizing *WindowResizingPayload `json:"window_resizing,omitempty"` StartGame *StartGamePayload `json:"start_game,omitempty"` GoHome *GoHomePayload `json:"go_home,omitempty"` ToggleStats *ToggleStatsPayload `json:"toggle_stats,omitempty"` TPS *TPSPayload `json:"tps,omitempty"` OpenTowerMenu *OpenTowerMenuPayload `json:"open_tower_menu,omitempty"` CloseTowerMenu *CloseTowerMenuPayload `json:"close_tower_menu,omitempty"` UserSignUp *UserSignUpPayload `json:"user_sign_up,omitempty"` SignUpError *SignUpErrorPayload `json:"sign_in_error,omitempty"` UserSignIn *UserSignInPayload `json:"user_sign_in,omitempty"` UserSignOut *UserSignOutPayload `json:"user_sign_out,omitempty"` AddPlayer *AddPlayerPayload `json:"add_player,omitempty"` RemovePlayer *RemovePlayerPayload `json:"remove_player,omitempty"` JoinWaitingRoom *JoinWaitingRoomPayload `json:"join_waiting_room,omitempty"` ExitWaitingRoom *ExitWaitingRoomPayload `json:"exit_waiting_room,omitempty"` SyncState *SyncStatePayload `json:"sync_state,omitempty"` SyncUsers *SyncUsersPayload `json:"sync_users,omitempty"` SyncWaitingRoom *SyncWaitingRoomPayload `json:"sync_waiting_room,omitempty"` }
func NewAddPlayer ¶
func NewCameraZoom ¶
func NewChangeUnitLine ¶
func NewCloseTowerMenu ¶
func NewCloseTowerMenu() *Action
func NewCursorMove ¶
func NewDeselectTower ¶
func NewExitWaitingRoom ¶
func NewIncomeTick ¶
func NewIncomeTick() *Action
func NewJoinWaitingRoom ¶
func NewNavigateTo ¶
func NewOpenTowerMenu ¶
func NewPlaceTower ¶
func NewRemovePlayer ¶
func NewRemoveTower ¶
func NewRemoveUnit ¶
func NewSelectTower ¶
func NewSelectedTowerInvalid ¶
func NewSignUpError ¶
func NewStartGame ¶
func NewStartGame() *Action
func NewStealLive ¶
func NewSummonUnit ¶
func NewSyncState ¶
func NewSyncState(players *SyncStatePlayersPayload, lines *SyncStateLinesPayload) *Action
TODO: or make the action.Action separated or make the store.Player separated
func NewSyncUsers ¶
func NewSyncWaitingRoom ¶
func NewToggleStats ¶
func NewToggleStats() *Action
func NewTowerAttack ¶
func NewUnitKilled ¶
func NewUserSignIn ¶
NewUserSignIn initializes the UserSignIn with just the username the rest of the data needs to be manually set by someone else
func NewUserSignOut ¶
func NewUserSignUp ¶
func NewWaitRoomCountdownTick ¶
func NewWaitRoomCountdownTick() *Action
func NewWindowResizing ¶
type AddPlayerPayload ¶
type CameraZoomPayload ¶
type CameraZoomPayload struct {
Direction int
}
type ChangeUnitLinePayload ¶
type ChangeUnitLinePayload struct {
UnitID string
}
type CloseTowerMenuPayload ¶
type CloseTowerMenuPayload struct{}
type CursorMovePayload ¶
type ExitWaitingRoomPayload ¶
type ExitWaitingRoomPayload struct {
Username string
}
type GoHomePayload ¶
type GoHomePayload struct{}
type JoinWaitingRoomPayload ¶
type JoinWaitingRoomPayload struct {
Username string
}
type NavigateToPayload ¶
type NavigateToPayload struct {
}type OpenTowerMenuPayload ¶
type OpenTowerMenuPayload struct {
TowerID string
}
type RemovePlayerPayload ¶
type RemovePlayerPayload struct {
ID string
}
type RemoveTowerPayload ¶
type RemoveUnitPayload ¶
type RemoveUnitPayload struct{ UnitID string }
type SelectTowerPayload ¶
type SelectedTowerInvalidPayload ¶
type SelectedTowerInvalidPayload struct {
Invalid bool
}
type SignUpErrorPayload ¶
type SignUpErrorPayload struct {
Error string
}
type StartGamePayload ¶
type StartGamePayload struct { }
type StealLivePayload ¶
type SummonUnitPayload ¶
type SyncStateLinePayload ¶ added in v1.0.3
type SyncStateLinePayload struct { Towers map[string]*SyncStateTowerPayload Units map[string]*SyncStateUnitPayload }
type SyncStateLinesPayload ¶ added in v1.0.3
type SyncStateLinesPayload struct {
Lines map[int]*SyncStateLinePayload
}
type SyncStatePayload ¶
type SyncStatePayload struct { Players *SyncStatePlayersPayload Lines *SyncStateLinesPayload }
type SyncStatePlayerPayload ¶
type SyncStatePlayersPayload ¶
type SyncStatePlayersPayload struct { Players map[string]*SyncStatePlayerPayload IncomeTimer int }
type SyncStateTowerPayload ¶
type SyncStateUnitPayload ¶
type SyncUsersPayload ¶
type SyncUsersPayload struct {
TotalUsers int
}
type SyncWaitingRoomPayload ¶
type TPSPayload ¶ added in v1.0.3
type ToggleStatsPayload ¶
type ToggleStatsPayload struct { }
type TowerAttackPayload ¶
type Type ¶
type Type int
const ( CursorMove Type = iota CameraZoom SummonUnit TPS RemoveUnit StealLive PlaceTower RemoveTower SelectTower SelectedTower SelectedTowerInvalid DeselectTower IncomeTick TowerAttack UnitKilled WindowResizing StartGame OpenTowerMenu CloseTowerMenu GoHome ChangeUnitLine SignUpError UserSignUp UserSignIn UserSignOut JoinWaitingRoom ExitWaitingRoom ToggleStats // Specific to WS AddPlayer RemovePlayer SyncState SyncUsers WaitRoomCountdownTick SyncWaitingRoom )
func TypeString ¶
TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Type) IsAType ¶
IsAType returns "true" if the value is listed in the enum definition. "false" otherwise
func (Type) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Type
func (*Type) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Type
type UnitKilledPayload ¶
type UserSignInPayload ¶
type UserSignOutPayload ¶
type UserSignOutPayload struct {
Username string
}
type UserSignUpPayload ¶
type UserSignUpPayload struct {
Username string
}
type WindowResizingPayload ¶
Click to show internal directories.
Click to hide internal directories.