Package megamek.common.util
Record Class FiringSolution
java.lang.Object
java.lang.Record
megamek.common.util.FiringSolution
Used to track data for displaying "FiringSolution" data in the BoardView. This contains information about to-hit
numbers and any other useful information for determining what units to are the best to shoot at.
-
Constructor Summary
ConstructorsConstructorDescriptionFiringSolution(ToHitData toHit, boolean targetSpotted) Creates an instance of aFiringSolutionrecord class. -
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.booleanReturns the value of thetargetSpottedrecord component.toHit()Returns the value of thetoHitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FiringSolution
Creates an instance of aFiringSolutionrecord class.- Parameters:
toHit- the value for thetoHitrecord componenttargetSpotted- the value for thetargetSpottedrecord component
-
-
Method Details
-
getToHitData
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
toHit
Returns the value of thetoHitrecord component.- Returns:
- the value of the
toHitrecord component
-
targetSpotted
public boolean targetSpotted()Returns the value of thetargetSpottedrecord component.- Returns:
- the value of the
targetSpottedrecord component
-