|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.Bay
public class Bay
Represtents a volume of space set aside for carrying ASFs and Small Craft aboard DropShips
| Field Summary | |
|---|---|
(package private) int |
currentSpace
The current amount of space available for troops. |
(package private) int |
doors
|
(package private) int |
doorsNext
|
(package private) java.util.Vector<java.lang.Integer> |
recoverySlots
|
(package private) int |
totalSpace
The total amount of space available for troops. |
(package private) java.util.Vector<Entity> |
troops
The troops being carried. |
| Constructor Summary | |
|---|---|
protected |
Bay()
The default constructor is only for serialization. |
|
Bay(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 |
destroyDoor()
|
void |
destroyDoorNext()
|
int |
getCargoMpReduction()
|
int |
getDoors()
|
int |
getDoorsNext()
|
java.util.Vector<Entity> |
getDroppableUnits()
get a vector of droppable units. |
Entity |
getExteriorUnitAt(int loc,
boolean isRear)
If a unit is being transported on the outside of the transporter, it can suffer damage when the transporter is hit by an attack. |
java.util.List<Entity> |
getExternalUnits()
|
java.util.Vector<Entity> |
getLaunchableUnits()
get a vector of launchable units. |
java.util.Vector<Entity> |
getLoadedUnits()
Get a List of the units currently loaded into this payload. |
java.lang.String |
getType()
|
java.lang.String |
getUnusedString()
Return a string that identifies the unused capacity of this transporter. |
boolean |
isWeaponBlockedAt(int loc,
boolean isRear)
Determine if transported units prevent a weapon in the given location from firing. |
void |
load(Entity unit)
Load the given unit. |
void |
resetDoors()
|
void |
setDoors(int d)
|
void |
setDoorsNext(int d)
|
boolean |
unload(Entity unit)
Unload the given unit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int doors
int doorsNext
java.util.Vector<java.lang.Integer> recoverySlots
java.util.Vector<Entity> troops
int totalSpace
int currentSpace
| Constructor Detail |
|---|
protected Bay()
public Bay(int space,
int doors)
space - - The weight of troops (in tons) this space can carry.| Method Detail |
|---|
public int getDoors()
public void setDoors(int d)
public void setDoorsNext(int d)
public int getDoorsNext()
public void resetDoors()
public boolean canLoad(Entity unit)
canLoad in interface Transporterunit - - the Entity to be loaded.
true if the unit can be loaded,
false otherwise.
public void load(Entity unit)
throws java.lang.IllegalArgumentException
load in interface Transporterunit - - the Entity to be loaded.
- - If the unit can't be loaded, an
IllegalArgumentException exception will be thrown.
java.lang.IllegalArgumentExceptionpublic java.util.Vector<Entity> getLoadedUnits()
List of the units currently loaded into this payload.
getLoadedUnits in interface TransporterList of loaded Entity units.
This list will never be null, but it may be empty.
The returned List is independant from the under-
lying data structure; modifying one does not affect the other.public java.util.Vector<Entity> getLaunchableUnits()
public java.util.Vector<Entity> getDroppableUnits()
public boolean unload(Entity unit)
unload in interface Transporterunit - - the Entity to be unloaded.
true if the unit was contained in this space,
false otherwise.public java.lang.String getUnusedString()
getUnusedString in interface TransporterString meant for a human.
public boolean isWeaponBlockedAt(int loc,
boolean isRear)
isWeaponBlockedAt in interface Transporterloc - - the int location attempting to fire.isRear - - a boolean value stating if the given
location is rear facing; if false, the location
is front facing.
true if a transported unit is in the way,
false if the weapon can fire.
public Entity getExteriorUnitAt(int loc,
boolean isRear)
getExteriorUnitAt in interface Transporterloc - - the int location hit by attack.isRear - - a boolean value stating if the given
location is rear facing; if false, the location
is front facing.
Entity being transported on the outside
at that location. This value will be null
if no unit is transported on the outside at that location.public final java.util.List<Entity> getExternalUnits()
getExternalUnits in interface Transporterpublic int getCargoMpReduction()
getCargoMpReduction in interface Transporterpublic java.lang.String getType()
public void destroyDoorNext()
public void destroyDoor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||