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} } }