Package org.lazywizard.lazylib.campaign
Class CargoUtils
Object
CargoUtils
Contains methods for working with cargo and item stacks.
- Since:
- 1.0
- Author:
- LazyWizard
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatgetSpaceTakenByCargo(CargoAPI cargo) Returns the amount of space taken by all cargo types in aCargoAPI.static floatReturns the amount of space taken by all commodities in aCargoAPI.static floatgetSpaceTakenByCrew(CargoAPI cargo) Returns the amount of space taken by crew in aCargoAPI.static floatgetSpaceTakenByFuel(CargoAPI cargo) Returns the amount of space taken by fuel in aCargoAPI.static floatgetSpaceTakenBySupplies(CargoAPI cargo) Returns the amount of space taken by supplies in aCargoAPI.static floatgetSpaceTakenByWeapons(CargoAPI cargo) Returns the amount of space taken by weapons in aCargoAPI.static booleanisShipInMothballed(String fleetMemberId, CargoAPI cargo) Checks if a cargo contains a specific mothballed ship.static voidMoves allCargoStackAPIs from oneCargoAPIto another.static voidmoveMothballedShips(CargoAPI from, CargoAPI to) Moves all mothballedFleetMemberAPIs from oneCargoAPIto another.static voidmoveStack(CargoStackAPI stack, CargoAPI to) Moves an entireCargoStackAPIfrom its current location to anotherCargoAPI.static voidmoveStack(CargoStackAPI stack, SectorEntityToken to) Moves an entireCargoStackAPIfrom its current location to theCargoAPIof anotherSectorEntityToken.
-
Method Details
-
moveStack
Moves an entireCargoStackAPIfrom its current location to anotherCargoAPI.- Parameters:
stack- TheCargoStackAPIto be moved.to- The destinationCargoAPI.- Since:
- 1.0
-
moveStack
Moves an entireCargoStackAPIfrom its current location to theCargoAPIof anotherSectorEntityToken.- Parameters:
stack- TheCargoStackAPIto be moved.to- The destinationSectorEntityToken.- Since:
- 1.2
-
moveMothballedShips
Moves all mothballedFleetMemberAPIs from oneCargoAPIto another. -
moveCargo
Moves allCargoStackAPIs from oneCargoAPIto another. -
isShipInMothballed
Checks if a cargo contains a specific mothballed ship.- Parameters:
fleetMemberId- The fleet member ID of the ship to check. This can be retrieved withShipAPI.getFleetMemberId()orFleetMemberAPI.getId().cargo- The cargo to check for the presence of this ship in.- Returns:
trueifcargocontains a ship with this ID,falseotherwise.- Since:
- 2.0
-
getSpaceTakenByWeapons
Returns the amount of space taken by weapons in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space taken by weapons in
cargo. - Since:
- 1.0
-
getSpaceTakenByCrew
Returns the amount of space taken by crew in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space taken by crew in
cargo. - Since:
- 1.0
-
getSpaceTakenBySupplies
Returns the amount of space taken by supplies in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space taken by supplies in
cargo. - Since:
- 1.0
-
getSpaceTakenByFuel
Returns the amount of space taken by fuel in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space taken by fuel in
cargo. - Since:
- 1.0
-
getSpaceTakenByCommodities
Returns the amount of space taken by all commodities in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space taken by commodity stacks in
cargo. - Since:
- 1.0
-
getSpaceTakenByCargo
Returns the amount of space taken by all cargo types in aCargoAPI.- Parameters:
cargo- TheCargoAPIto analyze.- Returns:
- The amount of space used in
cargo. - Since:
- 1.2
-