Documentation ¶
Index ¶
- Constants
- func Attack(c *gin.Context) (int, interface{})
- func Clear(c *gin.Context) (int, interface{})
- func ClearAll(c *gin.Context) (int, interface{})
- func EasterEgg(c *gin.Context) (int, interface{})
- func GetAsteroidStatus(c *gin.Context) (int, interface{})
- func Init(function func() Greet)
- func NewRoundAction()
- func Rank(c *gin.Context) (int, interface{})
- func Round(c *gin.Context) (int, interface{})
- func SendAttack(from int, to int)
- func SendStatus(team int, statusString string)
- func ServeWebSocket(c *gin.Context)
- func Status(c *gin.Context) (int, interface{})
- func Time(c *gin.Context) (int, interface{})
- type Greet
- type Hub
- type Team
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 GetAsteroidStatus ¶
func Init ¶
func Init(function func() Greet)
Init is used to init the asteroid. A function will be given to get the team rank data.
func NewRoundAction ¶
func NewRoundAction()
NewRoundAction runs in the new round begin. Refresh rank, clean all gameboxes' status, set round text, set time text.
func SendStatus ¶
SendStatus sends the teams' status message.
func ServeWebSocket ¶
ServeWebSocket handles websocket requests from the peer.
Types ¶
Click to show internal directories.
Click to hide internal directories.