finish world initialization, set up init on startup and on shutdown, move all models to main directory

This commit is contained in:
lbenedar
2026-04-24 18:04:35 +03:00
parent 07025afefc
commit fd65631be1
125 changed files with 1534 additions and 2802 deletions

View File

@@ -0,0 +1,60 @@
package json
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/models/db"
type Ring struct {
Enabled bool `json:"enabled"`
RingColors RingColors `json:"colors"`
Effects int `json:"effects"`
Subject Subject `json:"subject"`
}
func (r *Ring) ToDB(dest **db.Ring) bool {
if dest == nil {
return false
}
ring := &db.Ring{
Enabled: r.Enabled,
Effects: r.Effects,
}
r.RingColors.ToDB(&ring.RingColors)
r.Subject.ToDB(&ring.Subject)
*dest = ring
return true
}
type RingColors struct {
Ring string `json:"ring"`
Background string `json:"background"`
}
func (r *RingColors) ToDB(dest *db.RingColors) bool {
if dest == nil {
return false
}
dest.Ring = r.Ring
dest.Background = r.Background
return true
}
type Subject struct {
Scale int `json:"scale"`
Texture string `json:"texture"`
}
func (s *Subject) ToDB(dest *db.Subject) bool {
if dest == nil {
return false
}
dest.Scale = s.Scale
dest.Texture = s.Texture
return true
}