feat: produce ships

This commit is contained in:
Ilia Denisov
2026-01-20 13:33:53 +02:00
parent 40b2cb27f6
commit 7e73601bce
7 changed files with 96 additions and 43 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ const (
type Production struct {
Type ProductionType `json:"type"`
SubjectID *uuid.UUID `json:"subjectId"`
SubjectID *uuid.UUID `json:"subjectId"` // TODO: get rid of Nils?
Progress *float64 `json:"progress"`
}
+1
View File
@@ -71,6 +71,7 @@ func (st ShipType) EmptyMass() float64 {
}
// ProductionCost returns Material (MAT) and Population (POP) to produce this [ShipType]
// TODO: do we need this?
func (st ShipType) ProductionCost() (mat float64, pop float64) {
mat = st.EmptyMass()
pop = mat * 10