megamek.common.actions
Class PushAttackAction

java.lang.Object
  extended by megamek.common.actions.AbstractEntityAction
      extended by megamek.common.actions.AbstractAttackAction
          extended by megamek.common.actions.DisplacementAttackAction
              extended by megamek.common.actions.PushAttackAction
All Implemented Interfaces:
java.io.Serializable, AttackAction, EntityAction

public class PushAttackAction
extends DisplacementAttackAction

The attacker pushes the target.

See Also:
Serialized Form

Constructor Summary
PushAttackAction(int entityId, int targetId, Coords targetPos)
           
PushAttackAction(int entityId, int targetType, int targetId, Coords targetPos)
           
 
Method Summary
 ToHitData toHit(IGame game)
           
static ToHitData toHit(IGame game, int attackerId, Targetable target)
          To-hit number for the mech to push another mech
protected static java.lang.String toHitIsImpossible(IGame game, Entity ae, Targetable target)
          pushes are impossible when physical attacks are impossible, or a retractable blade is extended
 
Methods inherited from class megamek.common.actions.DisplacementAttackAction
getTargetPos, setTargetPos
 
Methods inherited from class megamek.common.actions.AbstractAttackAction
getEntity, getTarget, getTargetId, getTargetType, nightModifiers, setTargetId, setTargetType
 
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

PushAttackAction

public PushAttackAction(int entityId,
                        int targetId,
                        Coords targetPos)

PushAttackAction

public PushAttackAction(int entityId,
                        int targetType,
                        int targetId,
                        Coords targetPos)
Method Detail

toHit

public ToHitData toHit(IGame game)

toHitIsImpossible

protected static java.lang.String toHitIsImpossible(IGame game,
                                                    Entity ae,
                                                    Targetable target)
pushes are impossible when physical attacks are impossible, or a retractable blade is extended

Parameters:
game -
ae -
target -
Returns:

toHit

public static ToHitData toHit(IGame game,
                              int attackerId,
                              Targetable target)
To-hit number for the mech to push another mech