/*
* This file is part of sdbapi
* Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
*
* Licensed under GPL-3.0-only.
* See LICENSE for licensing information.
*/
package models
import (
"time"
"gorm.io/datatypes"
"gorm.io/gorm"
)
const (
GAMETURN_HOST uint8 = 0
GAMETURN_GUEST uint8 = 1
)
type GameData struct {
ID string `json:"id" gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
Actions []Action `json:"actions" gorm:"foreignKey:GameDataID"`
Turn uint8 `json:"turn" gorm:"type:smallint"`
// NOTE: These are not final
HostHand datatypes.JSON `json:"host_hand"`
HostDeck datatypes.JSON `json:"host_deck"`
GuestHand datatypes.JSON `json:"guest_hand"`
GuestDeck datatypes.JSON `json:"guest_deck"`
}