public class CargoUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static float |
getSpaceTakenByCargo(CargoAPI cargo)
Returns the amount of space taken by all cargo types in a
CargoAPI. |
static float |
getSpaceTakenByCommodities(CargoAPI cargo)
Returns the amount of space taken by all commodities in a
CargoAPI. |
static float |
getSpaceTakenByCrew(CargoAPI cargo)
Returns the amount of space taken by crew in a
CargoAPI. |
static float |
getSpaceTakenByFuel(CargoAPI cargo)
Returns the amount of space taken by fuel in a
CargoAPI. |
static float |
getSpaceTakenBySupplies(CargoAPI cargo)
Returns the amount of space taken by supplies in a
CargoAPI. |
static float |
getSpaceTakenByWeapons(CargoAPI cargo)
Returns the amount of space taken by weapons in a
CargoAPI. |
static boolean |
isShipInMothballed(String fleetMemberId,
CargoAPI cargo)
Checks if a cargo contains a specific mothballed ship.
|
static void |
moveCargo(CargoAPI from,
CargoAPI to)
Moves all
CargoStackAPIs from one CargoAPI to another. |
static void |
moveMothballedShips(CargoAPI from,
CargoAPI to)
Moves all mothballed
FleetMemberAPIs from one CargoAPI to
another. |
static void |
moveStack(CargoStackAPI stack,
CargoAPI to)
Moves an entire
CargoStackAPI from its current location to
another CargoAPI. |
static void |
moveStack(CargoStackAPI stack,
SectorEntityToken to)
Moves an entire
CargoStackAPI from its current location to the
CargoAPI of another SectorEntityToken. |
public static void moveStack(CargoStackAPI stack,
CargoAPI to)
CargoStackAPI from its current location to
another CargoAPI.stack - The CargoStackAPI to be moved.to - The destination CargoAPI.public static void moveStack(CargoStackAPI stack,
SectorEntityToken to)
CargoStackAPI from its current location to the
CargoAPI of another SectorEntityToken.stack - The CargoStackAPI to be moved.to - The destination SectorEntityToken.public static void moveMothballedShips(CargoAPI from,
CargoAPI to)
FleetMemberAPIs from one CargoAPI to
another.from - The CargoAPI to be emptied.to - The destination CargoAPI.public static void moveCargo(CargoAPI from,
CargoAPI to)
CargoStackAPIs from one CargoAPI to another.from - The CargoAPI to be emptied.to - The destination CargoAPI.moveStack(com.fs.starfarer.api.campaign.CargoStackAPI,
com.fs.starfarer.api.campaign.CargoAPI)public static boolean isShipInMothballed(String fleetMemberId, CargoAPI cargo)
fleetMemberId - The fleet member ID of the ship to check. This can
be retrieved with ShipAPI.getFleetMemberId()
or FleetMemberAPI.getId().cargo - The cargo to check for the presence of this ship in.true if cargo contains a ship with this ID,
false otherwise.public static float getSpaceTakenByWeapons(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.public static float getSpaceTakenByCrew(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.public static float getSpaceTakenBySupplies(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.public static float getSpaceTakenByFuel(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.public static float getSpaceTakenByCommodities(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.public static float getSpaceTakenByCargo(CargoAPI cargo)
CargoAPI.cargo - The CargoAPI to analyze.cargo.