Record Class Location
java.lang.Object
java.lang.Record
idlab.colonyops.model.Location
- Record Components:
x- the column, in[0, Planet.mapWidth())y- the row, in[0, Planet.mapHeight())
A tile coordinate on a
Planet's grid.
Distance and movement between locations use Chebyshev distance (a unit may move to any of the 8 surrounding tiles in a single step). The planet wraps around on both axes (toroidal topology): moving past one edge places you on the opposite edge, and distance calculations always use the shortest path, accounting for wrap-around.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.
-
Constructor Details
-
Location
-
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
-
y
-