Class EnumFacingMap<V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.EnumMap<net.minecraft.core.Direction,V>
org.cyclops.cyclopscore.datastructure.EnumFacingMap<V>
Type Parameters:
V - The value type.
All Implemented Interfaces:
Serializable, Cloneable, Map<net.minecraft.core.Direction,V>

public class EnumFacingMap<V> extends EnumMap<net.minecraft.core.Direction,V>
An efficient implementation for mapping facings to any value.
See Also:
  • Constructor Details

    • EnumFacingMap

      public EnumFacingMap()
    • EnumFacingMap

      public EnumFacingMap(EnumMap<net.minecraft.core.Direction,? extends V> m)
    • EnumFacingMap

      public EnumFacingMap(Map<net.minecraft.core.Direction,? extends V> m)
  • Method Details

    • newMap

      public static <V> EnumFacingMap<V> newMap()
      Make a new empty map.
      Type Parameters:
      V - Value type.
      Returns:
      The new map.
    • newMap

      public static <V> EnumFacingMap<V> newMap(EnumMap<net.minecraft.core.Direction,? extends V> m)
      Copy a map.
      Type Parameters:
      V - Value type.
      Parameters:
      m - The existing map.
      Returns:
      The new map.
    • newMap

      public static <V> EnumFacingMap<V> newMap(Map<net.minecraft.core.Direction,? extends V> m)
      Copy a map.
      Type Parameters:
      V - Value type.
      Parameters:
      m - The existing map.
      Returns:
      The new map.
    • forAllValues

      public static <V> EnumFacingMap<V> forAllValues(V down, V up, V north, V south, V west, V east)
      Make a new map for all the given facing values.
      Type Parameters:
      V - Value type.
      Parameters:
      down - Down
      up - Up
      north - North
      south - South
      west - West
      east - East
      Returns:
      The new map.