felt/models/models.go

49 lines
1.2 KiB
Go

package models
import (
"time"
)
type TableKey struct {
Name string `json:"name"`
Passcode string `json:"passcode"`
}
type DiceRoll struct {
Faces uint8 `json:"faces"`
Roll []uint8 `json:"roll"`
Player string `json:"player"`
Note string `json:"note"`
Timestamp time.Time `json:"timestamp"`
}
type Token struct {
Id *string `json:"id" bson:"_id"`
Name string `json:"name"`
Sprite string `json:"sprite"`
W int `json:"w"`
H int `json:"h"`
OX int `json:"oX"`
OY int `json:"oY"`
X *float64 `json:"x"`
Y *float64 `json:"y"`
Active bool `json:"active"`
}
type Table struct {
Name string `json:"name"`
Passcode string `json:"passcode"`
MapImageUrl string `json:"mapImg"`
DiceRolls []DiceRoll `json:"diceRolls"`
Tokens []Token `json:"tokens"`
AuxMessage string `json:"auxMsg"`
}
type TableMessage struct {
Auth *string `json:"auth,omitempty"`
Key *TableKey `json:"key"`
DiceRoll *DiceRoll `json:"diceRoll,omitempty"`
Token *Token `json:"token,omitempty"`
MapImg *string `json:"mapImg,omitempty"`
AuxMsg *string `json:"auxMsg,omitempty"`
}