support multi-module (#4)

* add multimodule
* re-package modules
This commit is contained in:
Ilia Denisov
2026-02-22 08:57:19 +02:00
committed by GitHub
parent 9e36d7151e
commit 8f982278d2
132 changed files with 317 additions and 191 deletions
+37
View File
@@ -0,0 +1,37 @@
package game
import (
"github.com/google/uuid"
)
type ProductionType string
const (
ProductionNone ProductionType = "-"
ProductionMaterial ProductionType = "MAT" // Сырьё
ProductionCapital ProductionType = "CAP" // Промышленность
ResearchDrive ProductionType = "DRIVE"
ResearchWeapons ProductionType = "WEAPONS"
ResearchShields ProductionType = "SHIELDS"
ResearchCargo ProductionType = "CARGO"
ResearchScience ProductionType = "SCIENCE"
ProductionShip ProductionType = "SHIP"
)
type Production struct {
Type ProductionType `json:"type"`
SubjectID *uuid.UUID `json:"subjectId,omitempty"`
Progress *Float `json:"progress,omitempty"`
ProdUsed *Float `json:"prodUsed,omitempty"`
}
func (p ProductionType) AsType(subject uuid.UUID) Production {
switch p {
case ResearchScience, ProductionShip:
return Production{Type: p, SubjectID: &subject}
default:
return Production{Type: p, SubjectID: nil}
}
}