|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.BattleArmorHandles
class BattleArmorHandles
Represtents a set of handles on an OmniMech used by Battle Armor units equiped with Boarding Claws to attach themselves for transport. This is standard equipment on OmniMechs.
MechFileParser.postLoadInit(megamek.common.Entity)| Field Summary | |
|---|---|
protected Entity |
troopers
The troopers being carried. |
| Constructor Summary | |
|---|---|
BattleArmorHandles()
Create a set of handles. |
|
| 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. |
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> |
getLoadedUnits()
Get a List of the units currently loaded into this
payload. |
java.lang.String |
getUnusedString()
Return a string that identifies the unused capacity of this transporter. |
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. |
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. |
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 |
|---|
protected Entity troopers
| Constructor Detail |
|---|
public BattleArmorHandles()
| Method Detail |
|---|
protected int[] getExteriorLocs(boolean isRear)
isRear - - a boolean value stating if the given
location is rear facing; if false, the
location is front facing.
int listing the exterior locations.protected java.lang.String getVacancyString(boolean isLoaded)
String to report the presence (or lack thereof) of
a loaded squad of Battle Armor troopers. Sub-classes are encouraged
to override this method.
isLoaded - - a boolean that indicates that troopers
are currently loaded (if the value is true) or
not (if the value is false).
String describing the occupancy state of this
transporter.public boolean canLoad(Entity unit)
canLoad in interface Transporterunit - - the Entity to be loaded.
true if the unit can be loaded, false
otherwise.
public final void load(Entity unit)
throws java.lang.IllegalArgumentException
load in interface Transporterunit - - the Entity to be loaded.
java.lang.IllegalArgumentException - - If the unit can't be loaded, an
IllegalArgumentException exception will be
thrown.public final 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 final boolean unload(Entity unit)
unload in interface Transporterunit - - the Entity to be unloaded.
true if the unit was contain is loadeded in this
space, false otherwise.public final java.lang.String getUnusedString()
Sub-classes should override the getVacancyString method.
getUnusedString in interface TransporterString meant for a human.getUnusedString()
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.megamek.common.BattleArmorHandles#getBlockedLocs(boolean)
public final Entity getExteriorUnitAt(int loc,
boolean isRear)
Sub-classes should override the getExteriorLocs method.
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.getExteriorLocs(boolean)public final java.util.List<Entity> getExternalUnits()
getExternalUnits in interface Transporterpublic int getCargoMpReduction()
getCargoMpReduction in interface Transporter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||