Package megamek.common.actions.sbf
Class SBFStandardUnitAttack
java.lang.Object
megamek.common.actions.sbf.AbstractSBFAttackAction
megamek.common.actions.sbf.SBFStandardUnitAttack
- All Implemented Interfaces:
Serializable,EntityAction,SBFAction,SBFAttackAction
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSBFStandardUnitAttack(int formationId, int unitNumber, int targetId, ASRange range) Creates a standard attack of an SBF Unit on another formation. -
Method Summary
Modifier and TypeMethodDescriptiongetHandler(SBFGameManager gameManager) getRange()intReturns the number of the SBF Unit making the attack, i.e.booleanisDataValid(SBFGame game) Validates the data of this action.Methods inherited from class megamek.common.actions.sbf.AbstractSBFAttackAction
getEntityId, getTargetId, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.actions.EntityAction
toAccessibilityDescription, toSummaryString
-
Constructor Details
-
SBFStandardUnitAttack
Creates a standard attack of an SBF Unit on another formation. The unit number identifies the SBF Unit making the attack, i.e. 1 for the first of the formation's units, 2 for the second etc.- Parameters:
formationId- The attacker's IDunitNumber- The number of the attacking SBF Unit inside the formationtargetId- The target's ID
-
-
Method Details
-
getUnitNumber
public int getUnitNumber()Returns the number of the SBF Unit making the attack, i.e. 1 for the first of the formation's units, 2 for the second.- Returns:
- The unit number within the formation
-
getRange
-
getHandler
- Returns:
- A handler that will process this action as an extension of the SBFGameManager
-
isDataValid
Description copied from interface:SBFActionValidates 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.- Parameters:
game- The game- Returns:
- true when this action is valid, false otherwise
-