Record Class MapDecoration
java.lang.Object
java.lang.Record
fr.fidorial.map.MapDecoration
- Record Components:
type- what icon to draw, seeMapDecorationTypeKeysx- the column of the center of the icon,0-128y- the row of the center of the icon,0-128direction- how far the icon is turned, in sixteenths of a turn clockwise,0-15:0upright, a player arrow pointing up (north on a terrain map),4pointing right (east),8down; seeMapManager.directionOf(float)label- a name written under the icon, ornull
public record MapDecoration(TypedKey<MapDecorationType> type, double x, double y, int direction, @Nullable Component label)
extends Record
An icon drawn over a map: a player arrow, a banner flag, a treasure cross...
Positions are in canvas pixels, like MapCanvas: (0, 0) is the top left corner
and (64, 64) the center. The client places icons on a grid of half pixels and clamps them
to the map. Use MapView.pixelX(double) and MapView.pixelY(double) to place an icon
at world coordinates.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMapDecoration(TypedKey<MapDecorationType> type, double x, double y, int direction, @Nullable Component label) Creates an instance of aMapDecorationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.
-
Constructor Details
-
MapDecoration
public MapDecoration(TypedKey<MapDecorationType> type, double x, double y, int direction, @Nullable Component label) Creates an instance of aMapDecorationrecord class.
-
-
Method Details
-
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. -
type
-
x
-
y
-
direction
-
label
-