Enum Class DrawSpace
- All Implemented Interfaces:
Serializable, Comparable<DrawSpace>, Constable
SCREEN is client-area pixels with the origin at the top left.
WORLD is game-world coordinates, which the producer projects to the
screen on its own thread — so a world command follows the thing it marks as the
camera moves, instead of being pinned where the camera happened to be when it
was sent.
Both work. Through phases 1 and 2 world space was accepted, validated and
then refused with "world space requires projection - not yet implemented";
the field shipped on the wire from the start precisely so this API's shape would
not have to change when projection landed, and it did not.
Not every primitive projects. A DrawKind.POLY is refused in world
space — its points live in a side slot with no room for a projected copy — and a
DrawKind.COMPONENT is already on screen, so it has no world position at
all.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionClient-area pixels, origin top-left.Game-world coordinates in fixed point (tile * 256 + subtile— seeDrawLimits.SUBTILE_SCALE), bounded byDrawLimits.MAX_WORLD_COORDINATErather than by the screen bound. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrawSpacefromWireName(String name) The space a producer reply spelled, defaulting toSCREEN.static DrawSpaceReturns the enum constant of this class with the specified name.static DrawSpace[]values()Returns an array containing the constants of this enum class, in the order they are declared.wireName()The lower-case token this space is spelled as in thespacefield.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
SCREEN
Client-area pixels, origin top-left. The default, and the one that works. -
WORLD
Game-world coordinates in fixed point (tile * 256 + subtile— seeDrawLimits.SUBTILE_SCALE), bounded byDrawLimits.MAX_WORLD_COORDINATErather than by the screen bound.
-
-
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
-
wireName
The lower-case token this space is spelled as in thespacefield. -
fromWireName
-