Class SBFStandardUnitAttack

java.lang.Object
megamek.common.actions.sbf.AbstractSBFAttackAction
megamek.common.actions.sbf.SBFStandardUnitAttack
All Implemented Interfaces:
Serializable, EntityAction, SBFAction, SBFAttackAction

public class SBFStandardUnitAttack extends AbstractSBFAttackAction
See Also:
  • Constructor Details

    • SBFStandardUnitAttack

      public SBFStandardUnitAttack(int formationId, int unitNumber, int targetId, ASRange range)
      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 ID
      unitNumber - The number of the attacking SBF Unit inside the formation
      targetId - 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

      public ASRange getRange()
    • getHandler

      public SBFActionHandler getHandler(SBFGameManager gameManager)
      Returns:
      A handler that will process this action as an extension of the SBFGameManager
    • isDataValid

      public boolean isDataValid(SBFGame game)
      Description copied from interface: SBFAction
      Validates 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