Enum Class MapScale

java.lang.Object
java.lang.Enum<MapScale>
fr.fidorial.map.MapScale
All Implemented Interfaces:
Serializable, Comparable<MapScale>, Constable

public enum MapScale extends Enum<MapScale>
How many blocks one pixel of a terrain map covers.

The constants are declared in network order: Enum.ordinal() is the zoom level the client shows in the tooltip of a map.

Since:
0.1.0
  • Enum Constant Details

    • ONE_TO_ONE

      public static final MapScale ONE_TO_ONE
      One pixel per block: the map covers 128×128 blocks. What an empty map makes.
    • ONE_TO_TWO

      public static final MapScale ONE_TO_TWO
      One pixel per 2×2 blocks: the map covers 256×256 blocks.
    • ONE_TO_FOUR

      public static final MapScale ONE_TO_FOUR
      One pixel per 4×4 blocks: the map covers 512×512 blocks.
    • ONE_TO_EIGHT

      public static final MapScale ONE_TO_EIGHT
      One pixel per 8×8 blocks: the map covers 1024×1024 blocks.
    • ONE_TO_SIXTEEN

      public static final MapScale ONE_TO_SIXTEEN
      One pixel per 16×16 blocks: the map covers 2048×2048 blocks.
  • Method Details

    • values

      public static MapScale[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MapScale valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • level

      public int level()
      Returns the zoom level, 0-4.
      Returns:
      the zoom level, 0-4
      Since:
      0.1.0
    • blocksPerPixel

      public int blocksPerPixel()
      Returns how many blocks one side of a pixel covers.
      Returns:
      how many blocks one side of a pixel covers
      Since:
      0.1.0
    • blocks

      public int blocks()
      Returns how many blocks one side of the map covers.
      Returns:
      how many blocks one side of the map covers
      Since:
      0.1.0