Enum DirectionCardinal

    • Method Detail

      • values

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

        public static DirectionCardinal valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • translateNeighborVector

        public static final DirectionCardinal translateNeighborVector​(int difX,
                                                                      int difY)
                                                               throws IllegalArgumentException
        Parameters:
        difX - a value in { - 1, 0, +1}
        difY - a value in { - 1, 0, +1}
        Returns:
        the direction difX or difY represent or null otherweise.
        Throws:
        IllegalArgumentException - if (difX, difY) does not point to a neighbor square
      • getBit

        public int getBit()
      • isSet

        public final boolean isSet​(int bits)
      • isMainDirection

        public final boolean isMainDirection()
      • isIntermediateDirection

        public final boolean isIntermediateDirection()