game

package
v0.0.0-...-70b03c1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WAITING = 0
	STARTED = 1
	OVER    = 2
	BROKEN  = 3
)

Variables

This section is empty.

Functions

func NewGame

func NewGame() *game

func NewHub

func NewHub() *hub

NewHub create new hub

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client - game Client

func NewClient

func NewClient(conn Connection, hub *hub) *Client

func (*Client) Run

func (c *Client) Run()

func (*Client) Send

func (c *Client) Send(message *message)

type Connection

type Connection interface {
	ReadMessage() (messageType int, p []byte, err error)
	SetWriteDeadline(t time.Time) error
	WriteMessage(messageType int, data []byte) error
	NextWriter(messageType int) (io.WriteCloser, error)
	Close() error
}

Jump to

Keyboard shortcuts

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