Class AbstractAttackAction
java.lang.Object
megamek.common.autoResolve.acar.action.AbstractAttackAction
- All Implemented Interfaces:
EntityAction
,Action
,AttackAction
- Direct Known Subclasses:
StandardUnitAttack
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface megamek.common.autoResolve.acar.action.Action
getHandler, isDataValid, isInvalid
Methods inherited from interface megamek.common.actions.EntityAction
toAccessibilityDescription, toSummaryString
-
Constructor Details
-
AbstractAttackAction
public AbstractAttackAction(int entityId, int targetId)
-
-
Method Details
-
getEntityId
public int getEntityId()- Specified by:
getEntityId
in 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 allInGameObject
s that are handled in the game.
-
getTargetId
public int getTargetId()- Specified by:
getTargetId
in interfaceAttackAction
- Returns:
- The game ID of the target of the attack
-
toString
-