Documentation ¶
Index ¶
- Constants
- func DefaultSaveLocation() (string, error)
- func NewErrMissingKey(m, key string) error
- func ResearchNames() []string
- func ResourceNames() []string
- func SpaceshipParts() []string
- type AchievementsManager
- type Building
- type BuildingType
- type ConsumerProducer
- type EditBuildingsOptions
- type EnvironmentObject
- type ErrMissingKey
- type FactoryProductionLogic
- type HabitatProductionLogic
- type Market
- type NewWorldPersistent
- type ResearchManager
- type SaveData
- type Savegame
- func (s *Savegame) AddStarterWorkers(count int) int64
- func (s *Savegame) Backup() (string, error)
- func (s *Savegame) Data() *SaveData
- func (s *Savegame) EditBuildings(opt EditBuildingsOptions)
- func (s *Savegame) GetRepairedSpaceshipParts() []string
- func (s *Savegame) GetResearchQueue() []string
- func (s *Savegame) GetResource(key string) (int, bool)
- func (s *Savegame) GetStarterWorkerCount() int
- func (s *Savegame) GetUnlockedResearch() []string
- func (s *Savegame) LockResearch(name string)
- func (s *Savegame) Path() string
- func (s *Savegame) Prefix() string
- func (s *Savegame) RepairSpaceshipPart(name string)
- func (s *Savegame) Save() error
- func (s *Savegame) SetResource(key string, value int) error
- func (s *Savegame) UnlockAllResearch()
- func (s *Savegame) UnlockResearch(name string)
- type Spaceship
- type UnlockabilityStatus
- type Worker
Constants ¶
View Source
const ( GAME_VERSION = "1.49.446" RESOURCE_FACTOR = 100 BUILDING_MAX_STORAGE = 1000 SPACESHIP_UNLOCK_VALUE = 1 )
Variables ¶
This section is empty.
Functions ¶
func DefaultSaveLocation ¶ added in v0.2.0
func NewErrMissingKey ¶
func ResearchNames ¶ added in v0.2.0
func ResearchNames() []string
func ResourceNames ¶ added in v0.2.0
func ResourceNames() []string
func SpaceshipParts ¶ added in v1.1.0
func SpaceshipParts() []string
Types ¶
type AchievementsManager ¶
type AchievementsManager struct { UnlockabilityStatus UnlockabilityStatus `json:"unlockabilityStatus"` SerializedAchievementTrackers json.RawMessage `json:"serializedAchievementTrackers"` }
type Building ¶
type Building struct { BuildingName string `json:"buildingName"` CustomName json.RawMessage `json:"customName"` Road int64 `json:"road"` Pipes json.RawMessage `json:"pipes"` ID int64 `json:"ID"` Position json.RawMessage `json:"position"` Rotation json.Number `json:"rotation"` ConsumerProducer *ConsumerProducer `json:"consumerProducer"` MissingResourceDuration json.Number `json:"missingResourceDuration"` Upgrades json.RawMessage `json:"upgrades"` IntegratedNetEdges json.RawMessage `json:"integratedNetEdges"` TextModule json.RawMessage `json:"textModule"` StationModule json.RawMessage `json:"stationModule"` }
type BuildingType ¶
type BuildingType int
const ( TYPE_FACTORY BuildingType = iota TYPE_HABITAT BuildingType = iota TYPE_STOREHOUSE BuildingType = iota TYPE_RESEARCH BuildingType = iota TYPE_UNKNOWN BuildingType = iota )
type ConsumerProducer ¶
type ConsumerProducer struct { ProductionLogic interface{} `json:"productionLogic"` IncomingStorage []int64 `json:"incomingStorage"` OutgoingStorage []int64 `json:"outgoingStorage"` RequestStatusDirty bool `json:"requestStatusDirty"` LastStepPowerProduced json.Number `json:"lastStepPowerProduced"` LastStepPowerNeeded json.Number `json:"lastStepPowerNeeded"` Type BuildingType `json:"-"` }
func (*ConsumerProducer) UnmarshalJSON ¶
func (c *ConsumerProducer) UnmarshalJSON(data []byte) error
type EditBuildingsOptions ¶
type EnvironmentObject ¶
type ErrMissingKey ¶
type ErrMissingKey struct {
Map, Key string
}
func (*ErrMissingKey) Error ¶
func (e *ErrMissingKey) Error() string
type FactoryProductionLogic ¶
type FactoryProductionLogic struct { Type string `json:"$type"` ProductionDefinition json.RawMessage `json:"productionDefinition"` LogicOverride json.RawMessage `json:"logicOverride"` TerraformRadius json.Number `json:"terraformRadius"` TerraformType json.RawMessage `json:"terraformType"` ProductionTimeStep int64 `json:"productionTimeStep"` }
type HabitatProductionLogic ¶
type HabitatProductionLogic struct { Type string `json:"$type"` Storage map[string]json.Number `json:"storage"` MaxInhabitants int64 `json:"maxInhabitants"` HabitatLevel int64 `json:"habitatLevel"` Upgrade json.RawMessage `json:"upgrade"` Downgrade json.RawMessage `json:"downgrade"` PowerNeededForTenPeople json.Number `json:"powerNeededForTenPeople"` TargetInhabitants json.Number `json:"targetInhabitants"` UpgradeCountdown json.Number `json:"upgradeCountdown"` DowngradeCountdown json.Number `json:"downgradeCountdown"` Workers []Worker `json:"workers"` }
type Market ¶
type Market struct { StarterWorkers []Worker `json:"starterWorkers"` ResourcePriorities json.RawMessage `json:"resourcePriorities"` }
type NewWorldPersistent ¶
type NewWorldPersistent struct { HeightData string `json:"heightData"` AlphaData []string `json:"alphaData"` DetailData []string `json:"detailData"` BiomesData json.RawMessage `json:"biomesData"` }
type ResearchManager ¶
type ResearchManager struct { ResearchProgress map[string]int64 `json:"researchProgress"` CurrentResearch json.RawMessage `json:"currentResearch"` ResearchQueue []string `json:"researchQueue"` }
type SaveData ¶
type SaveData struct { MapSeed int64 `json:"mapSeed"` MapGenVersion int64 `json:"mapGenVersion"` NextID int64 `json:"nextID"` SimulationFrame int64 `json:"simulationFrame"` TotalGameTime json.Number `json:"totalGameTime"` TotalPlayTime json.Number `json:"totalPlayTime"` SaveFixGracePeriodActive bool `json:"saveFixGracePeriodActive"` WorldSettings json.RawMessage `json:"worldSettings"` Buildings []Building `json:"buildings"` BuildingConnectors json.RawMessage `json:"buildingConnectors"` BuildingGroups json.RawMessage `json:"buildingGroups"` NetEdges json.RawMessage `json:"netEdges"` NetNodes json.RawMessage `json:"netNodes"` Cars json.RawMessage `json:"cars"` Market Market `json:"market"` Resources map[string]int64 `json:"resources"` GoalManager json.RawMessage `json:"goalManager"` ResearchManager ResearchManager `json:"researchManager"` UpgradeManager json.RawMessage `json:"upgradeManager,omitempty"` PopulationManager json.RawMessage `json:"populationManager"` Statistics json.RawMessage `json:"statistics"` Camera json.RawMessage `json:"camera"` DistrictManager json.RawMessage `json:"districtManager"` TrainLineManager json.RawMessage `json:"trainLineManager"` Trains json.RawMessage `json:"trains"` CarCarriers json.RawMessage `json:"carCarriers"` Spaceship Spaceship `json:"spaceship"` PipeComponentManager json.RawMessage `json:"pipeComponentManager"` ScriptMods json.RawMessage `json:"scriptMods"` NewWorldPersistent NewWorldPersistent `json:"newWorldPersistent"` EnvironmentObjects []EnvironmentObject `json:"environmentObjects"` // Very Big Object ca. 8k lines TerraformingProgressString json.RawMessage `json:"terraformingProgressString"` AchievementsManager AchievementsManager `json:"achievementsManager"` TrailerModule json.RawMessage `json:"trailerModule"` StoryMessagesModule json.RawMessage `json:"storyMessagesModule"` Roads json.RawMessage `json:"roads"` Intersections json.RawMessage `json:"intersections"` }
type Savegame ¶
type Savegame struct { Changed bool // contains filtered or unexported fields }
func LoadSavegame ¶
Load the savegame from the path
func (*Savegame) AddStarterWorkers ¶
Increase the starter workers to the given count, return number of added workers
func (*Savegame) EditBuildings ¶
func (s *Savegame) EditBuildings(opt EditBuildingsOptions)
Edit the buildings with the given configuration
func (*Savegame) GetRepairedSpaceshipParts ¶ added in v1.1.0
Get the repaired spaceship parts
func (*Savegame) GetResearchQueue ¶ added in v1.0.2
Get research queue
func (*Savegame) GetResource ¶
Get a resource by name
func (*Savegame) GetStarterWorkerCount ¶ added in v0.2.0
Get the current number of starter workers
func (*Savegame) GetUnlockedResearch ¶ added in v0.2.0
Get unlocked research
func (*Savegame) LockResearch ¶ added in v0.2.0
Lock Research by name, if currently unlocked
func (*Savegame) RepairSpaceshipPart ¶ added in v1.1.0
Repair the specified spaceship part
func (*Savegame) SetResource ¶
Set the given resource
func (*Savegame) UnlockResearch ¶ added in v0.2.0
Unlock research by name
type Spaceship ¶ added in v1.1.0
type Spaceship struct { CurrentlyRepairedPartName json.RawMessage `json:"currentlyRepairedPartName"` Parts []struct { Type string `json:"$type,omitempty"` TargetPosition json.RawMessage `json:"targetPosition,omitempty"` Timer json.Number `json:"timer,omitempty"` Name string `json:"name"` CurrentSteps int64 `json:"currentSteps"` } `json:"parts"` CurrentlyRepairedPartNameKBackingField json.RawMessage `json:"<currentlyRepairedPartName>k__BackingField"` }
type UnlockabilityStatus ¶
type UnlockabilityStatus struct { DisabledDueToMods bool `json:"disabledDueToMods"` DisabledDueToCreativeSettings bool `json:"disabledDueToCreativeSettings"` DisabledDueToSettingsModification bool `json:"disabledDueToSettingsModification"` DisabledDueToCheats bool `json:"disabledDueToCheats"` DisabledDueToModsBackingField bool `json:"<disabledDueToMods>k__BackingField"` DisabledDueToCreativeSettingsBackingField bool `json:"<disabledDueToCreativeSettings>k__BackingField"` DisabledDueToSettingsModificationBackingField bool `json:"<disabledDueToSettingsModification>k__BackingField"` DisabledDueToCheatsBackingField bool `json:"<disabledDueToCheats>k__BackingField"` }
Click to show internal directories.
Click to hide internal directories.