34 lines
812 B
Go
34 lines
812 B
Go
package json
|
|
|
|
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
|
|
|
|
type Grid struct {
|
|
Type int `json:"type"`
|
|
Size int `json:"size,omitempty"`
|
|
Color string `json:"color,omitempty"`
|
|
Alpha float64 `json:"alpha,omitempty"`
|
|
Distance int `json:"distance"`
|
|
Units string `json:"units"`
|
|
Diagonals int `json:"diagonals,omitempty"`
|
|
Style string `json:"style,omitempty"`
|
|
Thickness int `json:"thickness,omitempty"`
|
|
}
|
|
|
|
func (g *Grid) ToDB(dest *db.Grid) bool {
|
|
if dest == nil {
|
|
return false
|
|
}
|
|
|
|
dest.Type = g.Type
|
|
dest.Size = g.Size
|
|
dest.Color = g.Color
|
|
dest.Alpha = g.Alpha
|
|
dest.Distance = g.Distance
|
|
dest.Units = g.Units
|
|
dest.Diagonals = g.Diagonals
|
|
dest.Style = g.Style
|
|
dest.Thickness = g.Thickness
|
|
|
|
return true
|
|
}
|