Record Class DestinationReachedStopCondition
java.lang.Object
java.lang.Record
megamek.common.strategicBattleSystems.DestinationReachedStopCondition
- All Implemented Interfaces:
StopCondition<SBFMovePath>
public record DestinationReachedStopCondition(BoardLocation destination)
extends Record
implements StopCondition<SBFMovePath>
Returns true if last processed move path had final position equal to destination.
-
Constructor Summary
ConstructorsConstructorDescriptionDestinationReachedStopCondition(BoardLocation destination) Creates an instance of aDestinationReachedStopConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedestinationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DestinationReachedStopCondition
Creates an instance of aDestinationReachedStopConditionrecord class.- Parameters:
destination- the value for thedestinationrecord component
-
-
Method Details
-
shouldStop
- Specified by:
shouldStopin interfaceStopCondition<SBFMovePath>- Parameters:
e- the last edge that was successfully relaxed- Returns:
- true iff algorithm should stop searching for new paths
-
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 withObjects::equals(Object,Object). -
destination
Returns the value of thedestinationrecord component.- Returns:
- the value of the
destinationrecord component
-