Record Class DrawCommand.Area
- Record Components:
key- the command's identity within this connectionstyle- colour, stroke, fill, order and lifetimetileX- minimum-corner world tile XtileY- minimum-corner world tile YwidthTiles- width in tilesheightTiles- height in tilesplane-0..DrawLimits.MAX_PLANEcaption- the label drawn against the resolved footprint, orDrawCaption.NONE
- All Implemented Interfaces:
DrawCommand, DrawCommand.Highlight
- Enclosing interface:
DrawCommand
widthTiles by heightTiles block of ground,
anchored at its minimum corner.
Everything DrawCommand.Tile says applies, including the plane-by-refusal rule:
an area on a floor the local player is not standing on resolves
unavailable and draws nothing.
kind() reports DrawKind.TILE rather than an area
of its own, because that is what the producer stores — highlight_area
and highlight_tile write one kind with different extents, so an area
reads back from debug_draw_list spelled tile. Reporting a kind
this host invented would make DrawEntry.kind() disagree with the
producer for the same drawing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface DrawCommand
DrawCommand.Area, DrawCommand.ComponentTarget, DrawCommand.Ellipse, DrawCommand.Entity, DrawCommand.Highlight, DrawCommand.Line, DrawCommand.Poly, DrawCommand.Primitive, DrawCommand.Rect, DrawCommand.Text, DrawCommand.Tile -
Constructor Summary
ConstructorsConstructorDescriptionArea(String key, DrawStyle style, int tileX, int tileY, int widthTiles, int heightTiles, int plane, DrawCaption caption) Creates an instance of aArearecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringautoKey(int tileX, int tileY, int widthTiles, int heightTiles, int plane) The key an area highlight gets when the caller names none:area:<x>:<y>:<w>:<h>:<plane>.caption()Returns the value of thecaptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theheightTilesrecord component.key()Returns the value of thekeyrecord component.kind()The primitive this command draws.intplane()Returns the value of theplanerecord component.style()Returns the value of thestylerecord component.inttileX()Returns the value of thetileXrecord component.inttileY()Returns the value of thetileYrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thewidthTilesrecord component.Methods inherited from interface DrawCommand.Highlight
space
-
Constructor Details
-
Area
public Area(String key, DrawStyle style, int tileX, int tileY, int widthTiles, int heightTiles, int plane, DrawCaption caption) Creates an instance of aArearecord class.- Parameters:
key- the value for thekeyrecord componentstyle- the value for thestylerecord componenttileX- the value for thetileXrecord componenttileY- the value for thetileYrecord componentwidthTiles- the value for thewidthTilesrecord componentheightTiles- the value for theheightTilesrecord componentplane- the value for theplanerecord componentcaption- the value for thecaptionrecord component
-
-
Method Details
-
autoKey
The key an area highlight gets when the caller names none:area:<x>:<y>:<w>:<h>:<plane>.The extent is in the key for the same reason the plane is — two areas sharing a corner at different sizes are two different regions, and a key that omitted the size would let the second silently replace the first. Worst case is 32 bytes, inside
DrawLimits.MAX_KEY_BYTES. -
kind
Description copied from interface:DrawCommandThe primitive this command draws.- Specified by:
kindin interfaceDrawCommand
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceDrawCommand- Returns:
- the value of the
keyrecord component
-
style
Returns the value of thestylerecord component.- Specified by:
stylein interfaceDrawCommand- Returns:
- the value of the
stylerecord component
-
tileX
-
tileY
-
widthTiles
public int widthTiles()Returns the value of thewidthTilesrecord component.- Returns:
- the value of the
widthTilesrecord component
-
heightTiles
public int heightTiles()Returns the value of theheightTilesrecord component.- Returns:
- the value of the
heightTilesrecord component
-
plane
-
caption
Returns the value of thecaptionrecord component.- Specified by:
captionin interfaceDrawCommand.Highlight- Returns:
- the value of the
captionrecord component
-