consts

package
v0.0.0-...-85a0464 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsStart = "INTERACTIVE_SIGNAL_START"
	IsStop  = "INTERACTIVE_SIGNAL_STOP"

	MinPlayers = 2
	MaxPlayers = 3

	PlayTimeout        = 40 * time.Second
	PlayMahjongTimeout = 30 * time.Second
)

Variables

View Source
var (
	ErrorsExist                  = NewErr(1, true, "Exist. ")
	ErrorsChanClosed             = NewErr(1, true, "Chan closed. ")
	ErrorsTimeout                = NewErr(1, false, "Timeout. ")
	ErrorsInputInvalid           = NewErr(1, false, "Input invalid. ")
	ErrorsChatUnopened           = NewErr(1, false, "Chat disabled. ")
	ErrorsAuthFail               = NewErr(1, true, "Auth fail. ")
	ErrorsRoomInvalid            = NewErr(1, true, "Room invalid. ")
	ErrorsGameTypeInvalid        = NewErr(1, false, "Game type invalid. ")
	ErrorsRoomPlayersIsFull      = NewErr(1, false, "Room players is fill. ")
	ErrorsRoomPassword           = NewErr(1, false, "Sorry! Password incorrect! ")
	ErrorsJoinFailForRoomRunning = NewErr(1, false, "Join fail, room is running. ")
	ErrorsGamePlayersInvalid     = NewErr(1, false, "Game players invalid. ")
	ErrorsPokersFacesInvalid     = NewErr(1, false, "Pokers faces invalid. ")
	ErrorsHaveToPlay             = NewErr(1, false, "Have to play. ")
	ErrorsMustHaveToPlay         = NewErr(1, false, "There is a hand that can be played and must be played. ")
	ErrorsEndToPlay              = NewErr(1, false, "Can only come out at the end. ")

	GameTypes = map[GameType]string{
		Mahjong: "Mahjong",
		Uno:     "uno",
	}
	GameTypesIds = []GameType{Mahjong, Uno}
	RoomStates   = map[RoomState]string{
		Waiting: "Waiting",
		Running: "Running",
	}
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code int
	Msg  string
	Exit bool
}

func NewErr

func NewErr(code int, exit bool, msg string) Error

func (Error) Error

func (e Error) Error() string

type GameType

type GameType int
const (
	Mahjong GameType
	Uno
)

type RoomState

type RoomState int
const (
	Waiting RoomState
	Running
)

type StateID

type StateID int
const (
	StateWelcome StateID
	StateLogin
	StateRegister
	StateHome
	StateJoin
	StateCreate
	StateWaiting
	StateGame
	StateUnoGame
	StateMahjong
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL