Documentation ¶
Index ¶
- Constants
- type Body
- type BodyType
- type EmptyOrbit
- type GasGiant
- func (gg *GasGiant) FromMap(init map[string]interface{})
- func (gg *GasGiant) GetOrbit() (int, int)
- func (gg *GasGiant) GetType() BodyType
- func (gg *GasGiant) MarshalJSON() ([]byte, error)
- func (gg *GasGiant) SetType(bt BodyType) error
- func (gg *GasGiant) ToMap() map[string]interface{}
- func (gg *GasGiant) UnmarshalJSON(b []byte) error
- type MinorPlanet
- type Orbit
- type Planet
- type Region
- type Star
- func (s *Star) FromMap(init map[string]interface{})
- func (s *Star) GetNearestMajorClass() string
- func (s *Star) GetOrbits(zones ...Zone) map[int]interface{}
- func (s *Star) GetType() BodyType
- func (s *Star) MarshalJSON() ([]byte, error)
- func (s *Star) ToMap() map[string]interface{}
- func (s *Star) UnmarshalJSON(b []byte) error
- type StarPosition
- type StarSystem
- func (ss *StarSystem) Coordinate() string
- func (ss *StarSystem) FromMap(init map[string]interface{})
- func (ss *StarSystem) GetBodies(bodyTypes ...BodyType) []Orbit
- func (ss *StarSystem) MarshalJSON() ([]byte, error)
- func (ss *StarSystem) ToMap() map[string]interface{}
- func (ss *StarSystem) UnmarshalJSON(b []byte) error
- type Starport
- type StellarClass
- type StellarSize
- type TradeClassification
- type TradeClassifications
- type TravelZone
- type UniversalPlanetProfile
- type Zone
Constants ¶
const ( RockyPlanet BodyType = iota SmallGasGiant LargeGasGiant PlanetoidBelt StellarBody Empty StellarBodyString = "star" SmallGasGiantString = "small_gas_giant" LargeGasGiantString = "large_gas_giant" PlanetoidBeltString = "planetoid_belt" RockyPlanetString = "rocky_planet" )
const ( Ring = 0 Small = -1 )
const ( SOLITARY int = 7 BINARY int = 11 TRINARY int = 12 )
const ( StarportA = iota StarportB StarportC StarportD StarportE StarportX StarportY StarportH StarportG StarportF StarportNone )
const CENTER = -1 << (bits.UintSize - 1) // MIN_INT
const FAR_ORBIT = 1<<(bits.UintSize-1) - 1 // MAX_INT
const NEAR_ORBIT = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyType ¶
type BodyType int
func (BodyType) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (*BodyType) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value
type EmptyOrbit ¶
func (*EmptyOrbit) GetOrbit ¶
func (eo *EmptyOrbit) GetOrbit() (int, int)
func (*EmptyOrbit) GetType ¶
func (eo *EmptyOrbit) GetType() BodyType
func (*EmptyOrbit) MarshalJSON ¶
func (eo *EmptyOrbit) MarshalJSON() ([]byte, error)
func (*EmptyOrbit) ToMap ¶
func (eo *EmptyOrbit) ToMap() map[string]interface{}
type GasGiant ¶
type GasGiant struct { Type BodyType Moons map[int]Planet // contains filtered or unexported fields }
func CreateGasGiant ¶
func CreateGasGiant(dg *util.DiceGenerator) *GasGiant
func (*GasGiant) MarshalJSON ¶
func (*GasGiant) UnmarshalJSON ¶
type MinorPlanet ¶
type MinorPlanet struct { Planet MainWorldId int Classifications TradeClassifications Zone Zone }
func (*MinorPlanet) GetType ¶
func (mp *MinorPlanet) GetType() BodyType
type Planet ¶
type Planet struct { Id int `json:"-"` Name string `json:"name"` UniversalPlanetProfile Port Starport `json:"starport"` ScoutBase bool `json:"scout"` Satellites map[int]*Planet `json:"-"` Classifications TradeClassifications `json:"classifications"` // contains filtered or unexported fields }
type Star ¶
type Star struct { Class StellarClass `json:"class"` Size StellarSize `json:"size"` SizeFraction int `json:"fraction"` Orbit int `json:"orbit"` }
func (*Star) GetNearestMajorClass ¶
func (*Star) MarshalJSON ¶
func (*Star) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value
type StarPosition ¶
type StarPosition int
const ( PRIMARY StarPosition = iota SECONDARY TERTIARY )
func (StarPosition) MarshalJSON ¶
func (sp StarPosition) MarshalJSON() ([]byte, error)
func (*StarPosition) UnmarshalJSON ¶
func (sp *StarPosition) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type StarSystem ¶
type StarSystem struct { Stars map[StarPosition]*Star `json:"stars"` *Planet X int `json:"x"` Y int `json:"y"` Sector string `json:"sector"` SubSector string `json:"subsector"` TravelZone TravelZone `json:"travel_zone,string"` Orbits []Orbit `json:"orbits"` // contains filtered or unexported fields }
func NewStarSystem ¶
func NewStarSystem(initial map[string]interface{}, dg *util.DiceGenerator) *StarSystem
func (*StarSystem) Coordinate ¶
func (ss *StarSystem) Coordinate() string
func (*StarSystem) FromMap ¶
func (ss *StarSystem) FromMap(init map[string]interface{})
func (*StarSystem) GetBodies ¶
func (ss *StarSystem) GetBodies(bodyTypes ...BodyType) []Orbit
func (*StarSystem) MarshalJSON ¶
func (ss *StarSystem) MarshalJSON() ([]byte, error)
func (*StarSystem) ToMap ¶
func (ss *StarSystem) ToMap() map[string]interface{}
func (*StarSystem) UnmarshalJSON ¶
func (ss *StarSystem) UnmarshalJSON(b []byte) error
type Starport ¶
type Starport int
func (Starport) MarshalJSON ¶
func (Starport) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value
type StellarClass ¶
type StellarClass int
StellarClass represents the spectral classification
const ( B StellarClass = iota A M K G F )
func GetAllStellarClasses ¶
func GetAllStellarClasses() []StellarClass
GetAllStellarClasses provides all stellar classes
func (StellarClass) MarshalJSON ¶
func (sc StellarClass) MarshalJSON() ([]byte, error)
func (*StellarClass) ToString ¶
func (sc *StellarClass) ToString() string
func (*StellarClass) UnmarshalJSON ¶
func (sc *StellarClass) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type StellarSize ¶
type StellarSize int
StellarSize represents the size of a star
const ( Ia StellarSize = iota Ib II III IV V VI D )
func GetAllStellarSizes ¶
func GetAllStellarSizes() []StellarSize
GetAllStellarSizes returns all valid stellar sizes
func (StellarSize) MarshalJSON ¶
func (ss StellarSize) MarshalJSON() ([]byte, error)
func (*StellarSize) ToString ¶
func (ss *StellarSize) ToString() string
func (*StellarSize) UnmarshalJSON ¶
func (ss *StellarSize) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type TradeClassification ¶
type TradeClassification int
const ( Agricultural TradeClassification = iota NonAgricultural Industrial NonIndustrial Rich Poor Farming Mining Colony Research Military )
func (TradeClassification) MarshalJSON ¶
func (tc TradeClassification) MarshalJSON() ([]byte, error)
func (*TradeClassification) UnmarshalJSON ¶
func (tc *TradeClassification) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type TradeClassifications ¶
type TradeClassifications map[TradeClassification]bool
func (TradeClassifications) MarshalJSON ¶
func (tc TradeClassifications) MarshalJSON() ([]byte, error)
func (TradeClassifications) UnmarshalJSON ¶
func (tc TradeClassifications) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type TravelZone ¶
type TravelZone int
TravelZone Interstellar Travel Zone
const ( Green TravelZone = iota Yellow Red )
func (TravelZone) MarshalJSON ¶
func (tz TravelZone) MarshalJSON() ([]byte, error)
func (*TravelZone) UnmarshalJSON ¶
func (tz *TravelZone) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type UniversalPlanetProfile ¶
type UniversalPlanetProfile struct { Size int `json:"size"` Atmosphere int `json:"atmosphere"` Hydro int `json:"hydro"` Population int `json:"population"` Government int `json:"government"` LawLevel int `json:"lawlevel"` TechLevel int `json:"techlevel"` }
func (*UniversalPlanetProfile) FromMap ¶
func (upp *UniversalPlanetProfile) FromMap(init map[string]interface{})
func (*UniversalPlanetProfile) ToMap ¶
func (upp *UniversalPlanetProfile) ToMap() map[string]interface{}
type Zone ¶
type Zone int
Zone stores orbital zone types
Orbit Zones (UNAVAILABLE = inside star, INNER = inside habitable zone, OUTER = outside habitable zone )
func (Zone) MarshalJSON ¶
func (*Zone) UnmarshalJSON ¶
UnmarshalJSON unmashals a quoted json string to the enum value