new game, fs repo layer
This commit is contained in:
@@ -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}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user