Package edu.ntnu.idi.idatt.dto
Record Class TileCoordinates
java.lang.Object
java.lang.Record
edu.ntnu.idi.idatt.dto.TileCoordinates
- Record Components:
row
- The row index of the tile.col
- The column index of the tile.
TileCoordinates.
A simple record class to represent the coordinates of a tile on a game board. It holds the row and column index of a tile.
-
Constructor Summary
ConstructorsConstructorDescriptionTileCoordinates
(int row, int col) Creates an instance of aTileCoordinates
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
col()
Returns the value of thecol
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
row()
Returns the value of therow
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
row
public int row()Returns the value of therow
record component.- Returns:
- the value of the
row
record component
-
col
public int col()Returns the value of thecol
record component.- Returns:
- the value of the
col
record component
-