Class Sector

java.lang.Object
mindustry.type.Sector

public class Sector extends Object
A small section of a planet.
  • Field Details

    • rect

      public final Sector.SectorRect rect
    • plane

      public final arc.math.geom.Plane plane
    • planet

      public final Planet planet
    • tile

      public final PlanetGrid.Ptile tile
    • id

      public final int id
    • save

      @Nullable public Saves.SaveSlot save
    • preset

      @Nullable public SectorPreset preset
    • info

      public SectorInfo info
    • threat

      public float threat
      Number 0-1 indicating the difficulty based on nearby bases.
    • generateEnemyBase

      public boolean generateEnemyBase
  • Constructor Details

  • Method Details

    • near

      public arc.struct.Seq<Sector> near()
    • near

      public void near(arc.func.Cons<Sector> cons)
    • displayThreat

      public String displayThreat()
      Displays threat as a formatted string.
    • unlocked

      public boolean unlocked()
      Returns:
      whether this sector can be landed on at all. Only sectors adjacent to non-wave sectors can be landed on.
    • allowLaunchSchematics

      public boolean allowLaunchSchematics()
    • allowLaunchLoadout

      public boolean allowLaunchLoadout()
    • saveInfo

      public void saveInfo()
    • loadInfo

      public void loadInfo()
    • clearInfo

      public void clearInfo()
      Removes any sector info.
    • getProductionScale

      public float getProductionScale()
    • isAttacked

      public boolean isAttacked()
    • hasBase

      public boolean hasBase()
      Returns:
      whether the player has a base (active save with a core) here.
    • hasEnemyBase

      public boolean hasEnemyBase()
      Returns:
      whether the enemy has a generated base here.
    • isBeingPlayed

      public boolean isBeingPlayed()
    • name

      public String name()
    • setName

      public void setName(String name)
    • icon

      @Nullable public arc.graphics.g2d.TextureRegion icon()
    • iconChar

      @Nullable public String iconChar()
    • isCaptured

      public boolean isCaptured()
    • hasSave

      public boolean hasSave()
    • locked

      public boolean locked()
    • getLight

      public float getLight()
      Returns:
      light dot product in the range [0, 1].
    • getSize

      public int getSize()
      Returns:
      the sector size, in tiles
    • removeItems

      public void removeItems(ItemSeq items)
    • removeItem

      public void removeItem(Item item, int amount)
    • addItems

      public void addItems(ItemSeq items)
    • items

      public ItemSeq items()
      Returns:
      items currently in this sector, taking into account playing state.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • makeRect

      protected Sector.SectorRect makeRect()
      Projects this sector onto a 4-corner square for use in map gen. Allocates a new object. Do not call in the main loop.