Record Class RecoveringNerveAction
java.lang.Object
java.lang.Record
megamek.common.autoResolve.acar.action.RecoveringNerveAction
- All Implemented Interfaces:
EntityAction,Action
-
Constructor Summary
ConstructorsConstructorDescriptionRecoveringNerveAction(int formationId) Creates an instance of aRecoveringNerveActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theformationIdrecord component.intgetHandler(SimulationManager gameManager) final inthashCode()Returns a hash code value for this object.booleanisDataValid(SimulationContext context) Validates the data of this action.toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.actions.EntityAction
toAccessibilityDescription, toSummaryString
-
Constructor Details
-
RecoveringNerveAction
public RecoveringNerveAction(int formationId) Creates an instance of aRecoveringNerveActionrecord class.- Parameters:
formationId- the value for theformationIdrecord component
-
-
Method Details
-
getEntityId
public int getEntityId()- Specified by:
getEntityIdin interfaceEntityAction- Returns:
- The ID of the acting game unit. Note that when an entity is destroyed, it may no longer be available from
Game.getEntity(int)but rather only fromGame.getOutOfGameEntity(int)orGame.getEntityFromAllSources(int). As this can happen in the middle of resolving complicated situations in the GameManager, this is a potential cause for bugs.
Note that this is not restricted toEntity; it can be used for allInGameObjects that are handled in the game.
-
getHandler
- Specified by:
getHandlerin interfaceAction- Returns:
- A handler that will process this action as an extension of the SBFGameManager
-
isDataValid
Description copied from interface:ActionValidates the data of this action. Validation should not check game rule details, only if the action can be handled without running into missing or false data (NullPointerExceptions). Errors should be logged. The action will typically be ignored and removed if validation fails.- Specified by:
isDataValidin interfaceAction- Parameters:
context- The simulation context- Returns:
- true when this action is valid, false otherwise
-
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 '=='. -
formationId
public int formationId()Returns the value of theformationIdrecord component.- Returns:
- the value of the
formationIdrecord component
-