Documentation
¶
Index ¶
- type Cluster
- type Colony
- type Game
- type Group
- type GroupUnits
- type Inventory
- type Nation
- type NaturalResource
- type Option
- func Options(opts ...Option) Option
- func WithAuthenticationData(root string) Option
- func WithGame(filename string) Option
- func WithHost(host string) Option
- func WithJwtData(root string) Option
- func WithMaxBodyLength(l int) Option
- func WithPort(port string) Option
- func WithReadTimeout(d time.Duration) Option
- func WithWriteTimeout(d time.Duration) Option
- type Planet
- type Population
- type Server
- type Skills
- type Star
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Colony ¶
type Colony struct { Id int `json:"colony-id"` Kind string `json:"kind"` Location struct { X int `json:"x"` Y int `json:"y"` Z int `json:"z"` Star int `json:"star,omitempty"` Orbit int `json:"orbit"` } `json:"location"` TechLevel int `json:"tech-level"` Population struct { Professional Population `json:"professional"` Soldier Population `json:"soldier"` Unskilled Population `json:"unskilled"` Unemployed Population `json:"unemployed"` ConstructionCrews int `json:"construction-crews,omitempty"` SpyTeams int `json:"spy-teams,omitempty"` Births int `json:"births,omitempty"` Deaths int `json:"deaths,omitempty"` } `json:"population"` Inventory []*Inventory `json:"inventory,omitempty"` FactoryGroups []*Group `json:"factory-groups,omitempty"` FarmGroups []*Group `json:"farm-groups,omitempty"` MiningGroups []*Group `json:"mining-groups,omitempty"` }
func (*Colony) TotalPopulation ¶
func (*Colony) TotalRation ¶
type Group ¶
type Group struct { Id int `json:"group-id,omitempty"` Name string `json:"name,omitempty"` Units []*GroupUnits `json:"units,omitempty"` }
type GroupUnits ¶
type Inventory ¶
type Inventory struct { Name string `json:"name"` Code string `json:"code,omitempty"` TechLevel int `json:"tech-level,omitempty"` OperationalQty int `json:"operational-qty,omitempty"` StowedQty int `json:"stowed-qty,omitempty"` }
func (Inventory) EnclosedMassUnits ¶
type Nation ¶
type Nation struct { Id int `json:"nation-id"` Name string `json:"name"` Speciality string `json:"speciality"` Government struct { Kind string `json:"kind"` Name string `json:"name"` } `json:"government"` HomePlanet struct { Name string `json:"name"` Location struct { X int `json:"x"` Y int `json:"y"` Z int `json:"z"` Star int `json:"star,omitempty"` Orbit int `json:"orbit"` } `json:"location"` } `json:"home-planet"` Skills Skills `json:"skills"` Colonies []*Colony `json:"colonies,omitempty"` }
type NaturalResource ¶
type Option ¶
func WithAuthenticationData ¶
func WithJwtData ¶
func WithMaxBodyLength ¶
func WithReadTimeout ¶
func WithWriteTimeout ¶
type Population ¶
type Population struct { Code string `json:"code,omitempty"` Qty int `json:"qty,omitempty"` Pay float64 `json:"pay,omitempty"` Ration float64 `json:"ration,omitempty"` }
func (*Population) TotalPay ¶
func (p *Population) TotalPay() int
TotalPay assumes that the base rates are per unit of population
PROFESSIONAL 0.375 CONSUMER GOODS SOLDIER 0.250 CONSUMER GOODS UNSKILLED WORKER 0.125 CONSUMER GOODS UNEMPLOYABLE 0.000 CONSUMER GOODS
func (*Population) TotalPopulation ¶
func (p *Population) TotalPopulation() int
func (*Population) TotalRation ¶
func (p *Population) TotalRation() int
TotalRation assumes that base ration is 0.25 food units per unit of population
Click to show internal directories.
Click to hide internal directories.