types

package
v0.0.0-...-8d8ea2a Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChangeReady   = "ready"
	ChangeSetting = "config"
	PlayerCount   = "players"
	StatusChanged = "status"
	StatusRequest = "status_req"
	Submit        = "submit"
	SubmitFailed  = "submit_failed"
	UsePowerUp    = "use"
)
View Source
const (
	Ready   = "ready"
	Active  = "active"
	Waiting = "waiting"
)
View Source
const (
	C          Language = "c"
	Cpp                 = "cpp"
	Go                  = "go"
	Python              = "python"
	JavaScript          = "javascript"
	Rust                = "rust"
)
View Source
const (
	Pending = "pending"
	Running = "active"
	End     = "end"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

type GameSettings

type GameSettings struct {
	Language Language
	Problem  string
}

type GameState

type GameState struct {
	sync.Mutex
	Status   GameStatus
	Settings GameSettings
}

func (*GameState) SafeSetSettings

func (gs *GameState) SafeSetSettings(s GameSettings)

func (*GameState) SafeSetStatus

func (gs *GameState) SafeSetStatus(s GameStatus)

func (*GameState) SetSettings

func (gs *GameState) SetSettings(s GameSettings)

func (*GameState) SetStatus

func (gs *GameState) SetStatus(s GameStatus)

type GameStatus

type GameStatus string

type Language

type Language string

type ObjectID

type ObjectID string

type PlayerState

type PlayerState struct {
	sync.Mutex
	Status ReadyState
	Socket *websocket.Conn
}

func (*PlayerState) SafeSetStatus

func (ps *PlayerState) SafeSetStatus(s ReadyState)

func (*PlayerState) SendMessage

func (ps *PlayerState) SendMessage(mt int, action Action, data interface{})

func (*PlayerState) SetStatus

func (ps *PlayerState) SetStatus(s ReadyState)

type PowerUp

type PowerUp int32

type ReadyState

type ReadyState string

Jump to

Keyboard shortcuts

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