Enum Class MapShade

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

public enum MapShade extends Enum<MapShade>
The four shades a client can draw each MapColor in.

Terrain maps use them to show relief: a pixel is drawn lighter when the ground rises towards the north and darker when it falls. The constants are declared in network order, so Enum.ordinal() is the value stored in the two low bits of a map pixel, see MapPalette.

Since:
0.1.0
  • Enum Constant Details

    • SHADOW

      public static final MapShade SHADOW
      Darker than normal, 180/255 of the color.
    • NORMAL

      public static final MapShade NORMAL
      The shade flat ground is drawn with, 220/255 of the color.
    • LIGHT

      public static final MapShade LIGHT
      The color itself, at full brightness.
    • DEEP_SHADOW

      public static final MapShade DEEP_SHADOW
      The darkest shade, 135/255 of the color. Vanilla terrain never uses it.
  • Method Details

    • values

      public static MapShade[] 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 MapShade 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
    • multiplier

      public int multiplier()
      Returns what the client multiplies each channel of the color by, out of 255.
      Returns:
      what the client multiplies each channel of the color by, out of 255
      Since:
      0.1.0