asteroid

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INIT      = "init"
	ATTACK    = "attack"
	RANK      = "rank"
	STATUS    = "status"
	ROUND     = "round"
	EGG       = "easterEgg"
	TIME      = "time"
	CLEAR     = "clear"
	CLEAR_ALL = "clearAll"
)

Variables

This section is empty.

Functions

func Attack

func Attack(from int, to int)

func Clear

func Clear(team int)

func ClearAll

func ClearAll()

func EasterEgg

func EasterEgg()

func InitAsteroid

func InitAsteroid(function func() Greet)

InitAsteroid is used to init the asteroid. A function will be given to get the team rank data.

func Rank

func Rank()

func Round

func Round(roundNumber int)

func ServeWebSocket

func ServeWebSocket(c *gin.Context)

ServeWebSocket handles websocket requests from the peer.

func Status

func Status(team int, statusString string)

func Time

func Time(time int)

Types

type Greet

type Greet struct {
	Title string
	Time  int
	Round int
	Team  []Team
}

Greet will been sent when the client connect to the server firstly.

type Hub

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

type Team

type Team struct {
	Id    int
	Name  string
	Rank  int
	Score int
}

Team is the team status struct.

Jump to

Keyboard shortcuts

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