cmd: delete ship type
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package game
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type PlanetProduction string
|
||||
|
||||
const (
|
||||
@@ -17,15 +19,15 @@ const (
|
||||
)
|
||||
|
||||
type ProductionType struct {
|
||||
Production PlanetProduction `json:"type"`
|
||||
SubjectName string `json:"subject"` // TODO: change to UUID
|
||||
Production PlanetProduction `json:"type"`
|
||||
SubjectID *uuid.UUID `json:"subjectId"`
|
||||
}
|
||||
|
||||
func (p PlanetProduction) AsType(subject string) ProductionType {
|
||||
func (p PlanetProduction) AsType(subject uuid.UUID) ProductionType {
|
||||
switch p {
|
||||
case ResearchScience, ProductionShip:
|
||||
return ProductionType{Production: p, SubjectName: subject}
|
||||
return ProductionType{Production: p, SubjectID: &subject}
|
||||
default:
|
||||
return ProductionType{Production: p}
|
||||
return ProductionType{Production: p, SubjectID: nil}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user