Enum Class DrawKind

java.lang.Object
java.lang.Enum<DrawKind>
com.botwithus.bot.api.draw.DrawKind
All Implemented Interfaces:
Serializable, Comparable<DrawKind>, Constable

public enum DrawKind extends Enum<DrawKind>
The primitive shapes the producer's overlay can retain.

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 Constants
    Enum Constant
    Description
    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.
    Axis-aligned ellipse inscribed in a rectangle, stroked or filled.
    A tracked entity — an NPC, another player, or the local player — named by EntityRef plus 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 Type
    Method
    Description
    static DrawKind
    The kind a producer reply spelled, or null when the producer named a kind this build does not know.
    boolean
    Whether debug_draw_set accepts this kind in its kind field.
    static DrawKind
    Returns the enum constant of this class with the specified name.
    static DrawKind[]
    Returns an array containing the constants of this enum class, in the order they are declared.
    The lower-case token this kind is spelled as in the kind field.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LINE

      public static final DrawKind LINE
      Straight segment between two points.
    • RECT

      public static final DrawKind RECT
      Axis-aligned rectangle, stroked or filled.
    • ELLIPSE

      public static final DrawKind ELLIPSE
      Axis-aligned ellipse inscribed in a rectangle, stroked or filled.
    • POLY

      public static final DrawKind POLY
      Open or closed polyline of 2..32 points.
    • TEXT

      public static final DrawKind TEXT
      A UTF-8 string anchored at a point.
    • COMPONENT

      public static final DrawKind 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

      public static final DrawKind ENTITY
      A tracked entity — an NPC, another player, or the local player — named by EntityRef plus 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 through highlight_entity and nowhere else.

    • TILE

      public static final DrawKind TILE
      A ground footprint on one plane, named in whole tiles. Produced by both highlight_tile and highlight_area — the producer stores one kind for the two calls, so an area comes back spelled tile with a bigger extent rather than as a kind of its own.

      Decode-only. See isSpellable().

  • Method Details

    • values

      public static DrawKind[] 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

      public static DrawKind valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • wireName

      public String wireName()
      The lower-case token this kind is spelled as in the kind field.
    • isSpellable

      public boolean isSpellable()
      Whether debug_draw_set accepts this kind in its kind field.

      False for ENTITY and TILE, and that asymmetry is the producer's, not this host's: both appear in debug_draw_list output — which is why they exist here at all, so a listed highlight decodes to a kind rather than to null — but ParseDrawKind deliberately omits them, and setting one is refused with the ordinary unknown kind error. They carry semantics no geometry key can express, so they are reached only through highlight_entity, highlight_tile and highlight_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.Highlight is not a DrawCommand.Primitive, so the encoder cannot put either of these on a set in the first place. It is here for a reader of a DrawEntry who wants to know why a kind they can see is one they cannot send.

    • fromWireName

      public static DrawKind fromWireName(String name)
      The kind a producer reply spelled, or null when the producer named a kind this build does not know. A decoder must tolerate that rather than throw: the producer is versioned separately and may grow a primitive.