saving new turn

This commit is contained in:
Ilia Denisov
2025-09-26 01:38:49 +03:00
parent 6d87ea6086
commit 282150a253
13 changed files with 170 additions and 57 deletions
+18 -15
View File
@@ -3,31 +3,34 @@ package game
import (
"math"
"github.com/google/uuid"
"github.com/iliadenisov/galaxy/pkg/number"
)
type ShipType struct {
Name string
Drive float64 // [0], [1...]
Armament uint
Weapons float64 // [0], [1...]
Shields float64 // [0], [1...]
Cargo float64 // [0], [1...]
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Drive float64 `json:"drive"` // [0], [1...]
Armament uint `json:"armament"`
Weapons float64 `json:"weapons"` // [0], [1...]
Shields float64 `json:"shields"` // [0], [1...]
Cargo float64 `json:"cargo"` // [0], [1...]
}
type ShipGroup struct {
Type ShipType
Number uint
State string // TODO: kinda enum: In_Orbit, In_Space, Transfer_State, Upgrade
Load float64 // Cargo loaded - "Масса груза"
Drive float64
Weapons float64
Shields float64
Cargo float64
TypeID uuid.UUID `json:"id"`
Type ShipType `json:"-"` // TODO: fill upon load from store
Number uint `json:"number"`
State string `json:"state"` // TODO: kinda enum: In_Orbit, In_Space, Transfer_State, Upgrade
Load float64 `json:"load"` // Cargo loaded - "Масса груза"
Drive float64 `json:"drive"`
Weapons float64 `json:"weapons"`
Shields float64 `json:"shields"`
Cargo float64 `json:"cargo"`
}
type Fleet struct {
ShipGroups []ShipGroup
ShipGroups []ShipGroup `json:"group"`
}
// TODO: test on real values