megamek.common.actions
Class AbstractAttackAction

java.lang.Object
  extended by megamek.common.actions.AbstractEntityAction
      extended by megamek.common.actions.AbstractAttackAction
All Implemented Interfaces:
java.io.Serializable, AttackAction, EntityAction
Direct Known Subclasses:
BAVibroClawAttackAction, BrushOffAttackAction, DisplacementAttackAction, LayExplosivesAttackAction, PhysicalAttackAction, ProtomechPhysicalAttackAction, RamAttackAction, SearchlightAttackAction, TeleMissileAttackAction, ThrashAttackAction, WeaponAttackAction

public abstract class AbstractAttackAction
extends AbstractEntityAction
implements AttackAction

Abstract superclass for any action where an entity is attacking another entity.

See Also:
Serialized Form

Constructor Summary
AbstractAttackAction(int entityId, int targetId)
           
AbstractAttackAction(int entityId, int targetType, int targetId)
           
 
Method Summary
 Entity getEntity(IGame g)
           
 Targetable getTarget(IGame g)
           
 int getTargetId()
           
 int getTargetType()
           
static ToHitData nightModifiers(IGame game, Targetable target, AmmoType atype, Entity attacker, boolean isWeapon)
          used by the toHit of derived classes atype may be null if not using an ammo based weapon
 void setTargetId(int targetId)
           
 void setTargetType(int targetType)
           
 
Methods inherited from class megamek.common.actions.AbstractEntityAction
getEntityId, setEntityId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface megamek.common.actions.EntityAction
getEntityId, setEntityId
 

Constructor Detail

AbstractAttackAction

public AbstractAttackAction(int entityId,
                            int targetId)

AbstractAttackAction

public AbstractAttackAction(int entityId,
                            int targetType,
                            int targetId)
Method Detail

getTargetType

public int getTargetType()
Specified by:
getTargetType in interface AttackAction

getTargetId

public int getTargetId()
Specified by:
getTargetId in interface AttackAction

setTargetType

public void setTargetType(int targetType)
Specified by:
setTargetType in interface AttackAction

setTargetId

public void setTargetId(int targetId)
Specified by:
setTargetId in interface AttackAction

getTarget

public Targetable getTarget(IGame g)

getEntity

public Entity getEntity(IGame g)

nightModifiers

public static ToHitData nightModifiers(IGame game,
                                       Targetable target,
                                       AmmoType atype,
                                       Entity attacker,
                                       boolean isWeapon)
used by the toHit of derived classes atype may be null if not using an ammo based weapon