Package mindustry.game
Class SectorInfo
java.lang.Object
mindustry.game.SectorInfo
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether attack mode is enabled here.intHow many times the player has tried to land at this sector with a fresh core.The best available core type.floatSpecial variables for simulation.floatSpecial variables for simulation.intWave where first boss shows up.Displayed icon, as content.floatSpecial variables for simulation.floatSpecial variables for simulation.floatDamage dealt to sector.Launch destination.arc.struct.ObjectMap<Item,SectorInfo.ExportStat> Export statistics.booleanWhether a core is available here.booleanWhether this sector has any enemy spawns.Displayed icon.arc.struct.ObjectFloatMap<Item>float[]arc.struct.ObjectMap<Item,SectorInfo.ExportStat> Import statistics, based on what launch pads are actually receiving.Items stored in all cores.intLast size of the map.Temporary seq for last imported items.Last sector preset name set to this sector.intLast size of the map.floatLight coverage in terms of radius.floatHow many minutes this sector has been captured.Display name.Sector that was launched from.arc.struct.ObjectMap<Item,SectorInfo.ExportStat> Core input statistics.arc.struct.ObjectMap<Item,SectorInfo.ExportStat> Raw item production statistics.arc.struct.Seq<UnlockableContent>Resources known to occur at this sector.floatHow long the player has been playing elsewhere.booleanWhether this sector was indicated to the player or not.intPacked core spawn position.intMax storage capacity.floatSpecial variables for simulation.floatSpecial variables for simulation.floatSpecial variables for simulation.booleanWhether this sector was ever fully captured.intWave # from statebooleanWhether waves are enabled here.floatTime between waves.intHow many waves have passed while the player was away.intWaves this sector can survive if under attack.intVersion of generated waves.intWave # from state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoideachImport(Planet planet, arc.func.Cons<Sector> cons) Iterates through every sector this one imports from.arc.struct.ObjectFloatMap<Item>floatfloatgetImportRate(Planet planet, Item item) float[]getImportRates(Planet planet) voidhandleCoreItem(Item item, int amount) Handles core item changes.voidhandleItemExport(Item item, int amount) Updates export statistics.voidhandleItemExport(ItemStack stack) Updates export statistics.voidhandleItemImport(Item item, int amount) Updates import statistics.voidhandleProduction(Item item, int amount) Handles raw production stats.booleanarc.struct.ObjectMap<Item,SectorInfo.ExportStat> importStats(Planet planet) voidPrepare data for writing to a save.voidrefreshImportRates(Planet planet) booleansectorDataMatches(Sector sector) voidupdate()Update averages of various stats, updates some special sector logic.voidwrite()Write contents of meta into main storage.
-
Field Details
-
production
Core input statistics. -
rawProduction
Raw item production statistics. -
export
Export statistics. -
imports
Import statistics, based on what launch pads are actually receiving. -
items
Items stored in all cores. -
bestCoreType
The best available core type. -
storageCapacity
public int storageCapacityMax storage capacity. -
hasCore
public boolean hasCoreWhether a core is available here. -
lastPresetName
Last sector preset name set to this sector. -
lastWidth
public int lastWidthLast size of the map. -
lastHeight
public int lastHeightLast size of the map. -
wasCaptured
public boolean wasCapturedWhether this sector was ever fully captured. -
origin
Sector that was launched from. -
destination
Launch destination. -
resources
Resources known to occur at this sector. -
waves
public boolean wavesWhether waves are enabled here. -
attack
public boolean attackWhether attack mode is enabled here. -
hasSpawns
public boolean hasSpawnsWhether this sector has any enemy spawns. -
attempts
public int attemptsHow many times the player has tried to land at this sector with a fresh core. -
wave
public int waveWave # from state -
winWave
public int winWaveWave # from state -
wavesSurvived
public int wavesSurvivedWaves this sector can survive if under attack. Based on wave in info. <0 means uncalculated. -
waveSpacing
public float waveSpacingTime between waves. -
damage
public float damageDamage dealt to sector. -
wavesPassed
public int wavesPassedHow many waves have passed while the player was away. -
spawnPosition
public int spawnPositionPacked core spawn position. -
secondsPassed
public float secondsPassedHow long the player has been playing elsewhere. -
minutesCaptured
public float minutesCapturedHow many minutes this sector has been captured. -
lightCoverage
public float lightCoverageLight coverage in terms of radius. -
name
Display name. -
icon
Displayed icon. -
contentIcon
Displayed icon, as content. -
waveVersion
public int waveVersionVersion of generated waves. When it doesn't match, new waves are generated. -
shown
public boolean shownWhether this sector was indicated to the player or not. -
sumHealth
public float sumHealthSpecial variables for simulation. -
sumRps
public float sumRpsSpecial variables for simulation. -
sumDps
public float sumDpsSpecial variables for simulation. -
bossHealth
public float bossHealthSpecial variables for simulation. -
bossDps
public float bossDpsSpecial variables for simulation. -
curEnemyHealth
public float curEnemyHealthSpecial variables for simulation. -
curEnemyDps
public float curEnemyDpsSpecial variables for simulation. -
bossWave
public int bossWaveWave where first boss shows up. -
importCooldownTimers
-
importRateCache
@Nullable public transient float[] importRateCache -
lastImported
Temporary seq for last imported items. Do not use.
-
-
Constructor Details
-
SectorInfo
public SectorInfo()
-
-
Method Details
-
sectorDataMatches
- Returns:
- whether the sector was last saved with the same preset. if false, this means the preset changed, and thus the spawn/plan data should be discarded.
-
handleCoreItem
Handles core item changes. -
handleProduction
Handles raw production stats. -
handleItemExport
Updates export statistics. -
handleItemExport
Updates export statistics. -
handleItemImport
Updates import statistics. -
getExport
-
hasExport
-
refreshImportRates
-
getImportRates
-
getImportRate
- Returns:
- the import rate of an item as item/second. This is the *raw* max import rate, not what landing pads are actually using.
-
write
public void write()Write contents of meta into main storage. -
prepare
Prepare data for writing to a save. -
update
public void update()Update averages of various stats, updates some special sector logic. Called every frame. -
exportRates
-
anyExports
public boolean anyExports() -
importStats
- Returns:
- a newly allocated map with import statistics. Use sparingly.
-
eachImport
Iterates through every sector this one imports from.
-