megamek.common
Class ClampMountTank

java.lang.Object
  extended by megamek.common.BattleArmorHandles
      extended by megamek.common.BattleArmorHandlesTank
          extended by megamek.common.ClampMountTank
All Implemented Interfaces:
java.io.Serializable, Transporter

 class ClampMountTank
extends BattleArmorHandlesTank

Represtents the space on a vehicle used by Battle Armor squads equiped with Magnetic Clamps to attach themselves for transport. This transporter gets assigned to all of a player's vehicles in the Exchange Phase if any Battle Armor squad equipped with a Magnetic Clamp is on that player's side.

See Also:
megamek.server.Server#executePhase(int), megamek.server.Server#checkForMagneticClamp()

Field Summary
 
Fields inherited from class megamek.common.BattleArmorHandles
troopers
 
Constructor Summary
ClampMountTank()
          Create a space to mount clamp-equipped troopers on a Mech.
 
Method Summary
 boolean canLoad(Entity unit)
          Determines if this object can accept the given unit.
 int getCargoMpReduction()
           
protected  int[] getExteriorLocs(boolean isRear)
          Get the exterior locations that a loaded squad covers.
protected  java.lang.String getVacancyString(boolean isLoaded)
          Get the String to report the presence (or lack thereof) of a loaded squad of Battle Armor troopers.
 
Methods inherited from class megamek.common.BattleArmorHandlesTank
isWeaponBlockedAt
 
Methods inherited from class megamek.common.BattleArmorHandles
getExteriorUnitAt, getExternalUnits, getLoadedUnits, getUnusedString, load, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClampMountTank

public ClampMountTank()
Create a space to mount clamp-equipped troopers on a Mech.

Method Detail

getExteriorLocs

protected int[] getExteriorLocs(boolean isRear)
Get the exterior locations that a loaded squad covers.

Sub-classes are encouraged to override this method.

Overrides:
getExteriorLocs in class BattleArmorHandlesTank
Parameters:
isRear - - a boolean value stating if the given location is rear facing; if false, the location is front facing.
Returns:
an array of int listing the exterior locations.

getVacancyString

protected java.lang.String getVacancyString(boolean isLoaded)
Get the String to report the presence (or lack thereof) of a loaded squad of Battle Armor troopers.

Sub-classes are encouraged to override this method.

Overrides:
getVacancyString in class BattleArmorHandles
Parameters:
isLoaded - - a boolean that indicates that troopers are currently loaded (if the value is true) or not (if the value is false).
Returns:
a String describing the occupancy state of this transporter.

getCargoMpReduction

public int getCargoMpReduction()
Specified by:
getCargoMpReduction in interface Transporter
Overrides:
getCargoMpReduction in class BattleArmorHandles
Returns:
the MP reduction due to cargo carried by this transporter

canLoad

public boolean canLoad(Entity unit)
Determines if this object can accept the given unit. The unit may not be of the appropriate type or there may be no room for the unit.

Specified by:
canLoad in interface Transporter
Overrides:
canLoad in class BattleArmorHandles
Parameters:
unit - - the Entity to be loaded.
Returns:
true if the unit can be loaded, false otherwise.