Record Class DrawCommand.Tile
- Record Components:
key- the command's identity within this connectionstyle- colour, stroke, fill, order and lifetimetileX- absolute world tile XtileY- absolute world tile Yplane-0..DrawLimits.MAX_PLANEcaption- the label drawn against the resolved footprint, orDrawCaption.NONE
- All Implemented Interfaces:
DrawCommand, DrawCommand.Highlight
- Enclosing interface:
DrawCommand
Coordinates are whole tiles, not sub-tiles — the producer's
highlight_tile is where the two units meet, so nothing downstream of
it sees both. A world-space DrawCommand.Rect at the same place takes
tile * DrawLimits.SUBTILE_SCALE instead.
plane is honoured by refusal, not by lookup, and a caller needs
to know that. The producer's only ground-height source is the local
player's own elevation, so a tile on any other plane resolves
unavailable — nothing is drawn, deliberately, rather than a marker
placed convincingly wrong on the player's floor. DrawCommand.Entity is the
exemption, because an entity carries its own height. So a tile highlight one
floor up is accepted, stored, and invisible until the player is on that floor;
that is the producer's answer to an unanswerable question, not a fault in this
binding.
Sends no w/h: highlight_tile refuses them
rather than dropping them, because a silently-ignored w is how a
caller ends up convinced a 5x5 highlight rendered as 1x1 because of a
projection bug. DrawCommand.Area is the call that takes an extent.
-
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
ConstructorsConstructorDescriptionTile(String key, DrawStyle style, int tileX, int tileY, int plane, DrawCaption caption) Creates an instance of aTilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringautoKey(int tileX, int tileY, int plane) The key a tile highlight gets when the caller names none:tile:<x>:<y>:<plane>, for exampletile:3200:3200:0.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.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.Methods inherited from interface DrawCommand.Highlight
space
-
Constructor Details
-
Tile
Creates an instance of aTilerecord class.- Parameters:
key- the value for thekeyrecord componentstyle- the value for thestylerecord componenttileX- the value for thetileXrecord componenttileY- the value for thetileYrecord componentplane- the value for theplanerecord componentcaption- the value for thecaptionrecord component
-
-
Method Details
-
autoKey
The key a tile highlight gets when the caller names none:tile:<x>:<y>:<plane>, for exampletile:3200:3200:0.The plane is in the key because it distinguishes two highlights. A key is an identity and a set under an existing key replaces it, so any field the key omits is a field two highlights can disagree on while colliding — and the loser vanishes with no error, because replacing is a legitimate operation. The same x/y on two floors is two tiles. The producer's first cut was
tile:<x>:<y>and collided for exactly that case. -
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
-
plane
-
caption
Returns the value of thecaptionrecord component.- Specified by:
captionin interfaceDrawCommand.Highlight- Returns:
- the value of the
captionrecord component
-