Package mekhq.campaign.unit
Interface ITransportedUnitsSummary
- All Known Implementing Classes:
AbstractTransportedUnitsSummary,ShipTransportedUnitsSummary,TacticalTransportedUnitsSummary,TowTransportedUnitsSummary
public interface ITransportedUnitsSummary
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransportedUnit(Unit unit) Adds a unit to our set of transported units.voidClears the set of units being transported by this unit.voidclearTransportedUnits(Campaign campaign) Bay unloading utility used when removing a bay-equipped Transport unit This removes all units assigned to the transport from itvoidfixReferences(Campaign campaign, Unit unit) Fixes references after loadingdoublegetCurrentTransportCapacity(TransporterType transporterType) Returns the current capacity of a transporter typeGets the different kinds of transporters the transport hasbooleanIf this unit is capable of transporting another unit, return truebooleanhasTransportCapacity(TransporterType transporterType) Returns true if the unit has capacity left for a transporter typebooleanGets a value indicating whether this unit is transporting units.voidrecalculateTransportCapacity(Vector<megamek.common.equipment.Transporter> transporters) Recalculates transport capacitybooleanremoveTransportedUnit(Unit unit) Removes a unit from our set of transported units.voidreplaceTransportedUnits(Set<Unit> newTransportedUnits) When fixing references we need to replace the transported unitsvoidsetCurrentTransportCapacity(TransporterType transporterType, double capacity) Sets the current transport capacity for the provided transport typevoidunloadTransport(Set<Unit> transportedUnits) Main method to be used for unloading units from a transport
-
Method Details
-
hasTransportedUnits
boolean hasTransportedUnits()Gets a value indicating whether this unit is transporting units.- Returns:
- true if the unit has any transported units
-
getTransportedUnits
- Returns:
- the set of units being transported by this unit.
-
addTransportedUnit
Adds a unit to our set of transported units.- Parameters:
unit- The unit being transported by this instance.
-
removeTransportedUnit
Removes a unit from our set of transported units.- Parameters:
unit- The unit to remove from our set of transported units.- Returns:
- True if the unit was removed, otherwise false.
-
clearTransportedUnits
void clearTransportedUnits()Clears the set of units being transported by this unit. -
hasTransportCapacity
boolean hasTransportCapacity()If this unit is capable of transporting another unit, return true- Returns:
- true if the unit can transport another unit
-
getTransportCapabilities
Set<TransporterType> getTransportCapabilities()Gets the different kinds of transporters the transport has- Returns:
- Set of Transporter types
-
hasTransportCapacity
Returns true if the unit has capacity left for a transporter type- Parameters:
transporterType- Does the unit have free capacity in this type?- Returns:
- True if the unit has capacity, false if not
-
getCurrentTransportCapacity
Returns the current capacity of a transporter type- Parameters:
transporterType- What kind of transporter types are we checking?- Returns:
- The current capacity of the transporter
-
setCurrentTransportCapacity
Sets the current transport capacity for the provided transport type- Parameters:
transporterType- What kind of transporter are we changing the capacity of?capacity- What is the new capacity?
-
recalculateTransportCapacity
Recalculates transport capacity- Parameters:
transporters- What transporters are we tracking the details of?
-
replaceTransportedUnits
When fixing references we need to replace the transported units- Parameters:
newTransportedUnits- The units that should be transported
-
clearTransportedUnits
Bay unloading utility used when removing a bay-equipped Transport unit This removes all units assigned to the transport from it- Parameters:
campaign- used to remove this unit as transport from any other units in the campaign
-
unloadTransport
Main method to be used for unloading units from a transport- Parameters:
transportedUnits- Units we wish to unload
-
fixReferences
Fixes references after loading
-