Enum Class Orientation
- All Implemented Interfaces:
Serializable, Comparable<Orientation>, Constable
Maps top-to-bottom image pixels into vertical walls or horizontal floor art.
The origin is the bottom-left image block. Columns extend along the selected right vector; source row zero lies at the far end of the image-up vector. Vertical names identify the outward-facing normal of a wall.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEast-facing wall, with image right pointing south.Horizontal art extending right eastward and up northward.Horizontal art extending right westward and up northward.Horizontal art extending right eastward and up southward.Horizontal art extending right westward and up southward.North-facing wall, with image right pointing east.South-facing wall, with image right pointing west.West-facing wall, with image right pointing north. -
Method Summary
Modifier and TypeMethodDescriptionstatic OrientationParses current and legacy names, ignoring case, underscores and hyphens.Maps a source pixel to a block coordinate relative to the bottom-left origin.static OrientationReturns the enum constant of this class with the specified name.static Orientation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORTH
North-facing wall, with image right pointing east. -
SOUTH
South-facing wall, with image right pointing west. -
EAST
East-facing wall, with image right pointing south. -
WEST
West-facing wall, with image right pointing north. -
FLAT_NORTHEAST
Horizontal art extending right eastward and up northward. -
FLAT_SOUTHEAST
Horizontal art extending right eastward and up southward. -
FLAT_NORTHWEST
Horizontal art extending right westward and up northward. -
FLAT_SOUTHWEST
Horizontal art extending right westward and up southward.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
position
Maps a source pixel to a block coordinate relative to the bottom-left origin.- Parameters:
origin- bottom-left blockcolumn- zero-based image columnrow- zero-based image row counted from the topheight- total image rows- Returns:
- mapped coordinate; callers validate indices and world bounds
-
parse
Parses current and legacy names, ignoring case, underscores and hyphens.- Parameters:
name- orientation name, optionally prefixed withUp- Returns:
- recognized orientation
- Throws:
IllegalArgumentException- if the name is unsupported
-