Package mekhq.campaign.unit
Interface ITransportedUnitsSummary
- All Known Implementing Classes:
AbstractTransportedUnitsSummary
,ShipTransportedUnitsSummary
,TacticalTransportedUnitsSummary
,TowTransportedUnitsSummary
public interface ITransportedUnitsSummary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransportedUnit
(Unit unit) Adds a unit to our set of transported units.void
Clears the set of units being transported by this unit.void
clearTransportedUnits
(Campaign campaign) Bay unloading utility used when removing a bay-equipped Transport unit This removes all units assigned to the transport from itvoid
fixReferences
(Campaign campaign, Unit unit) Fixes references after loadingdouble
getCurrentTransportCapacity
(TransporterType transporterType) Returns the current capacity of a transporter typeGets the different kinds of transporters the transport hasboolean
If this unit is capable of transporting another unit, return trueboolean
hasTransportCapacity
(TransporterType transporterType) Returns true if the unit has capacity left for a transporter typeboolean
Gets a value indicating whether or not this unit is transporting units.void
recalculateTransportCapacity
(Vector<megamek.common.Transporter> transporters) Recalculates transport capacityboolean
removeTransportedUnit
(Unit unit) Removes a unit from our set of transported units.void
replaceTransportedUnits
(Set<Unit> newTransportedUnits) When fixing references we need to replace the transported unitsvoid
setCurrentTransportCapacity
(TransporterType transporterType, double capacity) Sets the current transport capacity for the provided transport typevoid
unloadTransport
(Set<Unit> transportedUnits) Main method to be used for unloading units from a transport
-
Method Details
-
hasTransportedUnits
boolean hasTransportedUnits()Gets a value indicating whether or not 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 a 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
-