new game, fs repo layer

This commit is contained in:
Ilia Denisov
2025-09-23 18:36:22 +03:00
parent 84578dc61c
commit 4d733ae741
18 changed files with 880 additions and 54 deletions
+30
View File
@@ -0,0 +1,30 @@
package game
type PlanetProduction string
const (
ProductionNone PlanetProduction = "NONE"
ProductionMaterial PlanetProduction = "MAT"
ProductionCapital PlanetProduction = "CAP"
ProductionDrive PlanetProduction = "DRIVE"
ProductionWeapons PlanetProduction = "WEAPONS"
ProductionShields PlanetProduction = "SHIELDS"
ProductionCargo PlanetProduction = "CARGO"
ProductionScience PlanetProduction = "SCIENCE"
ProductionShip PlanetProduction = "SHIP"
)
type ProductionType struct {
Production PlanetProduction
SubjectName string
}
func (p PlanetProduction) AsType(subject string) ProductionType {
switch p {
case ProductionScience, ProductionShip:
return ProductionType{Production: p, SubjectName: subject}
default:
return ProductionType{Production: p}
}
}