Class Map

java.lang.Object
mindustry.maps.Map
All Implemented Interfaces:
Comparable<Map>, Publishable

public class Map extends Object implements Comparable<Map>, Publishable
  • Field Details

    • custom

      public final boolean custom
      Whether this is a custom map.
    • tags

      public final StringMap tags
      Metadata. Author description, display name, etc.
    • file

      public final Fi file
      Base file of this map. File can be named anything at all.
    • version

      public final int version
      Format version.
    • workshop

      public boolean workshop
      Whether this map is managed, e.g. downloaded from the Steam workshop.
    • width

      public int width
      Map width/height, shorts.
    • height

      public int height
      Map width/height, shorts.
    • texture

      public Texture texture
      Preview texture.
    • build

      public int build
      Build that this map was created in. -1 = unknown or custom build.
    • teams

      public IntSet teams
      All teams present on this map.
    • spawns

      public int spawns
      Number of enemy spawns on this map.
    • mod

      Associated mod. If null, no mod is associated.
  • Constructor Details

    • Map

      public Map(Fi file, int width, int height, StringMap tags, boolean custom, int version, int build)
    • Map

      public Map(Fi file, int width, int height, StringMap tags, boolean custom, int version)
    • Map

      public Map(Fi file, int width, int height, StringMap tags, boolean custom)
    • Map

      public Map(StringMap tags)
  • Method Details

    • getHightScore

      public int getHightScore()
    • safeTexture

      public Texture safeTexture()
    • previewFile

      public Fi previewFile()
    • cacheFile

      public Fi cacheFile()
    • setHighScore

      public void setHighScore(int score)
    • applyRules

      public Rules applyRules(Gamemode mode)
      Returns the result of applying this map's rules to the specified gamemode.
    • rules

      public Rules rules()
      This creates a new instance of Rules.
    • rules

      public Rules rules(Rules base)
    • filters

      public Seq<GenerateFilter> filters()
      Returns the generation filters that this map uses on load.
    • name

      public String name()
    • author

      public String author()
    • description

      public String description()
    • plainName

      public String plainName()
    • plainAuthor

      public String plainAuthor()
    • plainDescription

      public String plainDescription()
    • tag

      public String tag(String name)
    • hasTag

      public boolean hasTag(String name)
    • getSteamID

      public String getSteamID()
      Specified by:
      getSteamID in interface Publishable
      Returns:
      workshop item ID, or null if this isn't on the workshop.
    • addSteamID

      public void addSteamID(String id)
      Description copied from interface: Publishable
      adds a steam ID to this item once it's published. should save the item to make sure this change is persisted.
      Specified by:
      addSteamID in interface Publishable
    • removeSteamID

      public void removeSteamID()
      Description copied from interface: Publishable
      removes the item ID; called when the item isn't found.
      Specified by:
      removeSteamID in interface Publishable
    • steamTitle

      public String steamTitle()
      Specified by:
      steamTitle in interface Publishable
      Returns:
      default title of the listing.
    • steamDescription

      public String steamDescription()
      Specified by:
      steamDescription in interface Publishable
      Returns:
      standard steam listing description, may be null. this is editable by users after release.
    • steamTag

      public String steamTag()
      Specified by:
      steamTag in interface Publishable
      Returns:
      the tag that this content has. e.g. 'schematic' or 'map'.
    • createSteamFolder

      public Fi createSteamFolder(String id)
      Specified by:
      createSteamFolder in interface Publishable
      Returns:
      a folder with everything needed for this piece of content in it; does not need to be a copy.
    • createSteamPreview

      public Fi createSteamPreview(String id)
      Specified by:
      createSteamPreview in interface Publishable
      Returns:
      a preview file PNG.
    • extraTags

      public Seq<String> extraTags()
      Specified by:
      extraTags in interface Publishable
      Returns:
      any extra tags to add to this item.
    • prePublish

      public boolean prePublish()
      Description copied from interface: Publishable
      called before this item is published.
      Specified by:
      prePublish in interface Publishable
      Returns:
      true to signify that everything is cool and good, or false to significy that the user has done something wrong. if false is returned, make sure to show a dialog explaining the error.
    • compareTo

      public int compareTo(Map map)
      Specified by:
      compareTo in interface Comparable<Map>
    • toString

      public String toString()
      Overrides:
      toString in class Object