Documentation ¶
Index ¶
- Constants
- Variables
- func CountryName(countryId CountryId, country *Country) string
- type ArmyId
- type Battle
- type BattleRef
- type Bypass
- type BypassId
- type Color
- type ColorDef
- type Coordinate
- type Country
- type CountryFlag
- type CountryId
- type Date
- type Fleet
- type FleetId
- type GameState
- type Hyperlane
- type Megastructure
- type MegastructureId
- type Name
- type NameVariable
- type OwnedFleet
- type Planet
- type PlanetId
- type PlanetState
- type Pop
- type PopId
- type Sector
- type SectorId
- type Ship
- type ShipId
- type SpeciesId
- type Star
- func (s *Star) Bypasses() (bypasses []string)
- func (s *Star) Colonies(isHabitat bool) (colonies []*Planet)
- func (s *Star) HasCapital() bool
- func (s *Star) HasHyperRelay() bool
- func (s *Star) HasHyperlane(dst *Star) bool
- func (s *Star) HasPops() bool
- func (s *Star) HasSignificantMegastructures() bool
- func (s *Star) HasUpgradedStarbase() bool
- func (s *Star) IsDistant() bool
- func (s *Star) IsOwnedBy(countryId CountryId) bool
- func (s *Star) IsSignificant() bool
- func (s *Star) MegastructuresBySize(size int) (megastructures []*Megastructure)
- func (s *Star) MobileMilitaryFleets() []*Fleet
- func (s *Star) Name() string
- func (s *Star) Occupier() CountryId
- func (s *Star) Owner() CountryId
- func (s *Star) Point() sgmmath.Point
- func (s *Star) PrimaryStarbase() *Starbase
- type StarId
- type Starbase
- type StarbaseId
- type StarbaseMgr
- type StarbaseRole
- type Station
- type StationId
- type War
- type WarCountry
- type WarId
- type WarRef
- type WarRole
- type Wormhole
- type WormholeId
Constants ¶
View Source
const ( SectorCore = "core_sector" SectorNormal = "normal_sector" StarbaseOutpost = "starbase_level_outpost" StarbaseStarport = "starbase_level_starport" StarbaseStarhold = "starbase_level_starhold" StarbaseFortress = "starbase_level_starfortress" StarbaseCitadel = "starbase_level_citadel" StarbaseMarauder = "starbase_level_marauder" StarbaseCaravaneer = "starbase_level_caravaneer" StarbaseModuleShipyard = "shipyard" StarbaseModuleTradingHub = "trading_hub" StarbaseModuleAnchorage = "anchorage" StarbaseModuleGunBattery = "gun_battery" StarbaseModuleMissileBattery = "missile_battery" StarbaseModuleHangarBay = "hangar_bay" StarbaseBuildingFleetAcademy = "fleet_academy" StarbaseBuildingTitanYards = "titan_yards" StarbaseBuildingColossusYards = "colossus_yards" StarbaseBuildingTradingCompany = "offworld_trading_company" StarbaseBuildingCrewQuarters = "crew_quarters" StarbaseBuildingTargetComputer = "target_uplink_computer" StarbaseBuildingCommJammer = "communications_jammer" StarbaseBuildingDefenceGrid = "defense_grid" StarbaseBuildingDisruptionField = "disruption_field" StarbaseBuildingWarpFluctuator = "warp_fluctuator" MegastructureRingWorld = "ring_world" MegastructureDysonSphere = "dyson_sphere" MegastructureMatterUnzip = "matter_decompressor" MegastructureScienceNexus = "think_tank" MegastructureSentryArray = "spy_orb" MegastructureArtInstallation = "mega_art_installation" MegastructureInterstellarAssembly = "interstellar_assembly" MegastructureShipyard = "mega_shipyard" MegastructureStrategicCenter = "strategic_coordination_center" MegastructureGateway = "gateway" MegastructureLGate = "lgate_base" MegastructureHyperRelay = "hyper_relay" MegastructureQuantumCatapult = "quantum_catapult" MegastructureSizeRingWorld = 3 MegastructureSizeStar = 2 MegastructureSizePlanet = 1 FleetOwnershipNormal = "normal" FleetOwnershipLostControl = "lost_control" BattleTypeShips = "ships" BattleTypeArmies = "armies" )
View Source
const ( DistantStarInitializer = "distantstars_init" DistantStarInitializerLGate0 = "distantstars_init_00" DistantStarInitializerLGate6 = "distantstars_init_06" PlanetClassEcumenopolis = "pc_city" PlanetClassHabitat = "pc_habitat" PlanetClassShielded = "pc_shielded" PlanetDesignationCapital = "col_capital" BypassWormhole = "wormhole" BypassLGate = "lgate" BypassGateway = "gateway" BypassGatewayRuined = "gateway-ruined" BypassHyperRelay = "relay" BypassQuantumCatapult = "catapult" )
View Source
const ( NewFormatAdj1 = "%ADJECTIVE%" NewFormatAdj2 = "%ADJ%" NewFormatKeyAppend = "1" )
Variables ¶
View Source
var ( CountryNameFormats map[string]string EmpireNames map[string]string SpeciesNames map[string]string PrescriptedCountryNames map[string]string PlanetNames = map[string]string{ "PLANET_NAME_FORMAT": "<PARENT> <NUMERAL>", } )
View Source
var ColorMap struct { Colors map[string]*ColorDef `sgm:"colors"` }
View Source
var DefaultArmyId = ArmyId(math.MaxUint32)
View Source
var DefaultCountryId = CountryId(math.MaxUint32)
View Source
var DefaultFleetId = FleetId(math.MaxUint32)
View Source
var DefaultNames = map[string]string{}
View Source
var DefaultPlanetId = PlanetId(math.MaxUint32)
View Source
var DefaultSectorId = SectorId(math.MaxUint32)
View Source
var DefaultStarId = StarId(math.MaxUint32)
View Source
var DefaultStarbaseId = StarbaseId(math.MaxUint32)
View Source
var MegastructureSize = map[string]int{ MegastructureRingWorld: MegastructureSizeRingWorld, MegastructureDysonSphere: MegastructureSizeStar, MegastructureMatterUnzip: MegastructureSizeStar, MegastructureScienceNexus: MegastructureSizePlanet, MegastructureSentryArray: MegastructureSizePlanet, MegastructureArtInstallation: MegastructureSizePlanet, MegastructureInterstellarAssembly: MegastructureSizePlanet, MegastructureShipyard: MegastructureSizePlanet, MegastructureStrategicCenter: MegastructureSizePlanet, }
View Source
var MegastructureStages = map[string]int{
"ruined": -1,
"0": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"restored": 10,
"final": 20,
}
Functions ¶
func CountryName ¶
Types ¶
type Battle ¶
type Battle struct { DefenderIds []CountryId `sgm:"defenders"` AttackerIds []CountryId `sgm:"attackers"` AttackerVictory bool `sgm:"attacker_victory"` Date Date `sgm:"date"` Type string `sgm:"type"` StarId StarId `sgm:"system,id"` AttackerLosses int `sgm:"attacker_losses"` DefenderLosses int `sgm:"defender_losses"` }
type Coordinate ¶
type Country ¶
type Country struct { NameString string `sgm:"name"` NameStruct Name `sgm:"name,struct"` Flag CountryFlag `sgm:"flag"` CapitalId PlanetId `sgm:"capital"` Capital *Planet FleetMgr struct { OwnedFleets []OwnedFleet `sgm:"owned_fleets"` } `sgm:"fleets_manager"` Wars []WarRef }
type CountryFlag ¶
type CountryFlag struct {
Colors []string `sgm:"colors"`
}
type Fleet ¶
type Fleet struct { NameString string `sgm:"name"` NameStruct Name `sgm:"name,struct"` Station bool `sgm:"station"` Mobile bool `sgm:"mobile"` Civilian bool `sgm:"civilian"` MilitaryPower float64 `sgm:"military_power"` OwnerId CountryId `sgm:"owner,id"` Owner *Country OwnershipStatus string DebtorId CountryId `sgm:"-,id"` ShipIds []ShipId `sgm:"ships"` Ships []*Ship Starbase *Starbase }
func (*Fleet) IsTransport ¶
func (*Fleet) MilitaryPowerString ¶
type GameState ¶
type GameState struct { Name string `sgm:"name"` Date Date `sgm:"date"` Stars map[StarId]*Star `sgm:"galactic_object"` Planets PlanetState `sgm:"planets"` Bypasses map[BypassId]*Bypass `sgm:"bypasses"` Countries map[CountryId]*Country `sgm:"country"` Sectors map[SectorId]*Sector `sgm:"sectors"` StarbaseMgr StarbaseMgr `sgm:"starbase_mgr"` Megastructures map[MegastructureId]*Megastructure `sgm:"megastructures"` Fleets map[FleetId]*Fleet `sgm:"fleet"` Ships map[ShipId]*Ship `sgm:"ships"` Wars map[WarId]*War `sgm:"war"` Pops map[PopId]*Pop `sgm:"pop"` }
func LoadGameState ¶
type Megastructure ¶
type Megastructure struct { Type string `sgm:"type"` Owner int `sgm:"owner"` PlanetId PlanetId `sgm:"planet,id"` Star *Star Planet *Planet }
func (Megastructure) TypeStage ¶
func (m Megastructure) TypeStage() (string, int)
type MegastructureId ¶
type MegastructureId uint32
type Name ¶
type Name struct { Key string `sgm:"key"` Variables []NameVariable `sgm:"variables"` }
type NameVariable ¶
type OwnedFleet ¶
type Planet ¶
type Planet struct { Star *Star NameString string `sgm:"name"` NameStruct Name `sgm:"name,struct"` Class string `sgm:"planet_class"` Designation string `sgm:"final_designation"` Moons []PlanetId `sgm:"moons"` MoonOf PlanetId `sgm:"moon_of"` OrbitalFleetId FleetId `sgm:"orbital_defence,id"` OrbitalFleet *Fleet OwnerId CountryId `sgm:"owner,id"` EmployablePops int `sgm:"employable_pops"` }
func (*Planet) OrbitalStarbase ¶
type PlanetState ¶
type Sector ¶
type Star ¶
type Star struct { Type string `sgm:"type"` NameString string `sgm:"name"` NameStruct Name `sgm:"name,struct"` Initializer string `sgm:"initializer"` Coordinate Coordinate `sgm:"coordinate"` Hyperlanes []Hyperlane `sgm:"hyperlane"` SectorId SectorId `sgm:"sector,id"` Sector *Sector StarbaseId StarbaseId `sgm:"starbase,id"` StarbaseIds []StarbaseId `sgm:"starbases"` Starbases []*Starbase PlanetIds []PlanetId `sgm:"planet"` Planets []*Planet MegastructureIds []MegastructureId `sgm:"megastructures"` Megastructures []*Megastructure WormholeIds []WormholeId `sgm:"natural_wormholes"` Wormholes []*Wormhole FleetIds []FleetId `sgm:"fleet_presence"` Fleets []*Fleet Battles []BattleRef // contains filtered or unexported fields }
func (*Star) HasCapital ¶
func (*Star) HasHyperRelay ¶
func (*Star) HasHyperlane ¶
func (*Star) HasSignificantMegastructures ¶
func (*Star) HasUpgradedStarbase ¶
func (*Star) IsSignificant ¶
func (*Star) MegastructuresBySize ¶
func (s *Star) MegastructuresBySize(size int) (megastructures []*Megastructure)
func (*Star) MobileMilitaryFleets ¶
func (*Star) PrimaryStarbase ¶
type Starbase ¶
type Starbase struct { Level string `sgm:"level"` Modules map[int]string `sgm:"modules"` Buildings map[int]string `sgm:"buildings"` Owner CountryId `sgm:"owner,id"` StationId ShipId `sgm:"station,id"` Station *Ship Star *Star }
func (*Starbase) Role ¶
func (sb *Starbase) Role() StarbaseRole
type StarbaseId ¶
type StarbaseId uint32
type StarbaseMgr ¶
type StarbaseMgr struct {
Starbases map[StarbaseId]*Starbase `sgm:"starbases"`
}
type StarbaseRole ¶
type StarbaseRole int
const ( StarbaseRoleShipyard StarbaseRole = iota StarbaseRoleBastion StarbaseRoleAnchorage StarbaseRoleTradingHub StarbaseRoleMax )
func (StarbaseRole) String ¶
func (role StarbaseRole) String() string
type War ¶
type War struct { StartDate Date `sgm:"start_date"` Defenders []WarCountry `sgm:"defenders"` Attackers []WarCountry `sgm:"attackers"` Battles []Battle `sgm:"battles"` }
type WarCountry ¶
type WarCountry struct {
CountryId CountryId `sgm:"country,id"`
}
type WormholeId ¶
type WormholeId uint32
Click to show internal directories.
Click to hide internal directories.