megamek.common
Class ASFBay

java.lang.Object
  extended by megamek.common.Bay
      extended by megamek.common.ASFBay
All Implemented Interfaces:
java.io.Serializable, Transporter

public final class ASFBay
extends Bay

Represtents a volume of space set aside for carrying ASFs and Small Craft aboard DropShips

See Also:
Serialized Form

Field Summary
 
Fields inherited from class megamek.common.Bay
currentSpace, doors, doorsNext, recoverySlots, totalSpace, troops
 
Constructor Summary
protected ASFBay()
          The default constructor is only for serialization.
  ASFBay(int space, int doors)
          Create a space for the given tonnage of troops.
 
Method Summary
 boolean canLoad(Entity unit)
          Determines if this object can accept the given unit.
 void closeSlot()
           
 void destroyDoor()
           
 void destroyDoorNext()
           
 int getDoors()
           
 int getRecoverySlots()
           
 java.lang.String getType()
           
 java.lang.String getUnusedString()
          Return a string that identifies the unused capacity of this transporter.
 java.util.Vector<java.lang.Integer> initializeRecoverySlots()
           
 void load(Entity unit)
          Load the given unit.
 void recover(Entity unit)
           
 void updateSlots()
           
 
Methods inherited from class megamek.common.Bay
getCargoMpReduction, getDoorsNext, getDroppableUnits, getExteriorUnitAt, getExternalUnits, getLaunchableUnits, getLoadedUnits, isWeaponBlockedAt, resetDoors, setDoors, setDoorsNext, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASFBay

protected ASFBay()
The default constructor is only for serialization.


ASFBay

public ASFBay(int space,
              int doors)
Create a space for the given tonnage of troops. For this class, only the weight of the troops (and their equipment) are considered; if you'd like to think that they are stacked like lumber, be my guest.

Parameters:
space - - The weight of troops (in tons) this space can carry.
Method Detail

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 Bay
Parameters:
unit - - the Entity to be loaded.
Returns:
true if the unit can be loaded, false otherwise.

load

public void load(Entity unit)
          throws java.lang.IllegalArgumentException
Load the given unit.

Specified by:
load in interface Transporter
Overrides:
load in class Bay
Parameters:
unit - - the Entity to be loaded.
Throws:
- - If the unit can't be loaded, an IllegalArgumentException exception will be thrown.
java.lang.IllegalArgumentException

recover

public void recover(Entity unit)
             throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getUnusedString

public java.lang.String getUnusedString()
Description copied from class: Bay
Return a string that identifies the unused capacity of this transporter.

Specified by:
getUnusedString in interface Transporter
Overrides:
getUnusedString in class Bay
Returns:
A String meant for a human.

getType

public java.lang.String getType()
Overrides:
getType in class Bay

updateSlots

public void updateSlots()

initializeRecoverySlots

public java.util.Vector<java.lang.Integer> initializeRecoverySlots()

getRecoverySlots

public int getRecoverySlots()

closeSlot

public void closeSlot()

destroyDoorNext

public void destroyDoorNext()
Overrides:
destroyDoorNext in class Bay

destroyDoor

public void destroyDoor()
Overrides:
destroyDoor in class Bay

getDoors

public int getDoors()
Overrides:
getDoors in class Bay