Enum Class DrawKind
- All Implemented Interfaces:
Serializable, Comparable<DrawKind>, Constable
Mirrors overlay::DrawKind in NXTLibrary/src/overlay/DrawTypes.h
and the kind strings the debug_draw_set handler parses. The
wire spelling is lower-case; wireName() is the only thing that should
ever be put on the wire.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn interface component, named by(interfaceId, componentId)and carrying no geometry: the producer re-resolves the on-screen rect on the game thread once per tick, because the client recomputes a component's rect on every layout pass.Axis-aligned ellipse inscribed in a rectangle, stroked or filled.A tracked entity — an NPC, another player, or the local player — named byEntityRefplus a server index and carrying no coordinates: the producer re-reads the entity's live position every tick.Straight segment between two points.Open or closed polyline of 2..32 points.Axis-aligned rectangle, stroked or filled.A UTF-8 string anchored at a point.A ground footprint on one plane, named in whole tiles. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrawKindfromWireName(String name) The kind a producer reply spelled, ornullwhen the producer named a kind this build does not know.booleanWhetherdebug_draw_setaccepts this kind in itskindfield.static DrawKindReturns the enum constant of this class with the specified name.static DrawKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.wireName()The lower-case token this kind is spelled as in thekindfield.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
LINE
Straight segment between two points. -
RECT
Axis-aligned rectangle, stroked or filled. -
ELLIPSE
Axis-aligned ellipse inscribed in a rectangle, stroked or filled. -
POLY
Open or closed polyline of 2..32 points. -
TEXT
A UTF-8 string anchored at a point. -
COMPONENT
An interface component, named by(interfaceId, componentId)and carrying no geometry: the producer re-resolves the on-screen rect on the game thread once per tick, because the client recomputes a component's rect on every layout pass. -
ENTITY
A tracked entity — an NPC, another player, or the local player — named byEntityRefplus a server index and carrying no coordinates: the producer re-reads the entity's live position every tick.Decode-only. See
isSpellable(): this kind is reachable throughhighlight_entityand nowhere else. -
TILE
A ground footprint on one plane, named in whole tiles. Produced by bothhighlight_tileandhighlight_area— the producer stores one kind for the two calls, so an area comes back spelledtilewith a bigger extent rather than as a kind of its own.Decode-only. See
isSpellable().
-
-
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 kind is spelled as in thekindfield. -
isSpellable
public boolean isSpellable()Whetherdebug_draw_setaccepts this kind in itskindfield.False for
ENTITYandTILE, and that asymmetry is the producer's, not this host's: both appear indebug_draw_listoutput — which is why they exist here at all, so a listed highlight decodes to a kind rather than tonull— butParseDrawKinddeliberately omits them, and setting one is refused with the ordinaryunknown kinderror. They carry semantics no geometry key can express, so they are reached only throughhighlight_entity,highlight_tileandhighlight_area, where every parameter is named for what it means and a wrong one is reported by name. Spelling them on a set would accept{kind: "entity", x: 3, y: 4}and draw something nobody asked for.Nothing in this host needs to consult it to stay correct — a
DrawCommand.Highlightis not aDrawCommand.Primitive, so the encoder cannot put either of these on a set in the first place. It is here for a reader of aDrawEntrywho wants to know why a kind they can see is one they cannot send. -
fromWireName
-