Files
galaxy-game/pkg/model/game/race.go
T
2025-09-26 01:38:49 +03:00

37 lines
821 B
Go

package game
import "github.com/google/uuid"
type Race struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Extinct bool `json:"extinct"`
Vote uuid.UUID `json:"vote"`
Relations []RaceRelation `json:"relations"`
Drive float64 `json:"drive"`
Weapons float64 `json:"weapons"`
Shields float64 `json:"shields"`
Cargo float64 `json:"cargo"`
Sciences []Science `json:"science,omitempty"`
ShipTypes []ShipType `json:"shipType,omitempty"`
ShipGroups []ShipGroup `json:"shipGroup,omitempty"`
Fleets []Fleet `json:"fleet,omitempty"`
}
type RaceRelation struct {
RaceID uuid.UUID `json:"raceId"`
Peace bool `json:"peace"`
}
func (r Race) FlightDistance() float64 {
return r.Drive * 40
}
func (r Race) VisibilityDistance() float64 {
return r.Drive * 30
}