20 lines
311 B
Go
20 lines
311 B
Go
package models
|
|
|
|
type MsgType string
|
|
|
|
const (
|
|
InputMsgType MsgType = "input"
|
|
ChatMsgType MsgType = "chat"
|
|
)
|
|
|
|
type InputMessage struct {
|
|
PlayerID int64
|
|
DX float64 `json:"dx"`
|
|
DY float64 `json:"dy"`
|
|
}
|
|
|
|
type StateMessage struct {
|
|
Type MsgType `json:"type"`
|
|
Payload any `json:"payload"`
|
|
}
|