felt/models/models.go

50 lines
1.3 KiB
Go
Raw Normal View History

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 {
2023-07-09 06:48:19 +00:00
Id *string `json:"id" bson:"_id"`
Name *string `json:"name,omitempty"`
Sprite *string `json:"sprite,omitempty"`
W *int `json:"w,omitempty"`
H *int `json:"h,omitempty"`
OX *int `json:"oX,omitempty"`
OY *int `json:"oY,omitempty"`
2023-07-09 06:48:19 +00:00
X *float64 `json:"x"`
Y *float64 `json:"y"`
Active bool `json:"active"`
}
type Table struct {
2023-07-08 05:56:41 +00:00
Name string `json:"name"`
Passcode string `json:"passcode"`
MapImageUrl string `json:"mapImg"`
DiceRolls []DiceRoll `json:"diceRolls"`
Tokens []Token `json:"tokens"`
AuxMessage string `json:"auxMsg"`
}
2022-12-07 04:58:42 +00:00
type TableMessage struct {
Auth *string `json:"auth,omitempty"`
Key *TableKey `json:"key"`
2023-07-09 06:48:19 +00:00
DiceRoll *DiceRoll `json:"diceRoll,omitempty"`
Token *Token `json:"token,omitempty"`
MapImg *string `json:"mapImg,omitempty"`
AuxMsg *string `json:"auxMsg,omitempty"`
2022-12-22 04:45:15 +00:00
}