Package megamek.common.moves
Record Class Key
java.lang.Object
java.lang.Record
megamek.common.moves.Key
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoords()Returns the value of thecoordsrecord component.booleanIndicates whether some other object is "equal to" this one.intfacing()Returns the value of thefacingrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.inttype()Returns the value of thetyperecord component.
-
Constructor Details
-
Key
Creates an instance of aKeyrecord class.- Parameters:
coords- the value for thecoordsrecord componentfacing- the value for thefacingrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
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 '=='. -
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. -
coords
Returns the value of thecoordsrecord component.- Returns:
- the value of the
coordsrecord component
-
facing
public int facing()Returns the value of thefacingrecord component.- Returns:
- the value of the
facingrecord component
-
type
public int type()Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-