LazyLib

org.lazywizard.lazylib.campaign
Class CargoUtils

java.lang.Object
  extended by org.lazywizard.lazylib.campaign.CargoUtils

public class CargoUtils
extends java.lang.Object

Contains methods for working with cargo and item stacks.

Since:
1.0
Author:
LazyWizard

Method Summary
static float getSpaceTakenByCargo(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by all cargo types in a CargoAPI.
static float getSpaceTakenByCrew(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by crew in a CargoAPI.
static float getSpaceTakenByFuel(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by fuel in a CargoAPI.
static float getSpaceTakenByResources(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by all resources in a CargoAPI.
static float getSpaceTakenBySupplies(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by supplies in a CargoAPI.
static float getSpaceTakenByWeapons(com.fs.starfarer.api.campaign.CargoAPI cargo)
          Returns the amount of space taken by weapons in a CargoAPI.
static void moveCargo(com.fs.starfarer.api.campaign.CargoAPI from, com.fs.starfarer.api.campaign.CargoAPI to)
          Moves all CargoStackAPIs from one CargoAPI to another.
static void moveStack(com.fs.starfarer.api.campaign.CargoStackAPI stack, com.fs.starfarer.api.campaign.CargoAPI to)
          Moves an entire CargoStackAPI from its current location to another CargoAPI.
static void moveStack(com.fs.starfarer.api.campaign.CargoStackAPI stack, com.fs.starfarer.api.campaign.SectorEntityToken to)
          Moves an entire CargoStackAPI from its current location to the CargoAPI of another SectorEntityToken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

moveStack

public static void moveStack(com.fs.starfarer.api.campaign.CargoStackAPI stack,
                             com.fs.starfarer.api.campaign.CargoAPI to)
Moves an entire CargoStackAPI from its current location to another CargoAPI.

Parameters:
stack - The CargoStackAPI to be moved.
to - The destination CargoAPI.
Since:
1.0

moveStack

public static void moveStack(com.fs.starfarer.api.campaign.CargoStackAPI stack,
                             com.fs.starfarer.api.campaign.SectorEntityToken to)
Moves an entire CargoStackAPI from its current location to the CargoAPI of another SectorEntityToken.

Parameters:
stack - The CargoStackAPI to be moved.
to - The destination SectorEntityToken.
Since:
1.2

moveCargo

public static void moveCargo(com.fs.starfarer.api.campaign.CargoAPI from,
                             com.fs.starfarer.api.campaign.CargoAPI to)
Moves all CargoStackAPIs from one CargoAPI to another.

Parameters:
from - The CargoAPI to be emptied.
to - The destination CargoAPI.
Since:
1.0
See Also:
moveStack(com.fs.starfarer.api.campaign.CargoStackAPI, com.fs.starfarer.api.campaign.CargoAPI)

getSpaceTakenByWeapons

public static float getSpaceTakenByWeapons(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by weapons in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space taken by weapons in cargo.
Since:
1.0

getSpaceTakenByCrew

public static float getSpaceTakenByCrew(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by crew in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space taken by crew in cargo.
Since:
1.0

getSpaceTakenBySupplies

public static float getSpaceTakenBySupplies(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by supplies in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space taken by supplies in cargo.
Since:
1.0

getSpaceTakenByFuel

public static float getSpaceTakenByFuel(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by fuel in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space taken by fuel in cargo.
Since:
1.0

getSpaceTakenByResources

public static float getSpaceTakenByResources(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by all resources in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space taken by resource stacks in cargo.
Since:
1.0

getSpaceTakenByCargo

public static float getSpaceTakenByCargo(com.fs.starfarer.api.campaign.CargoAPI cargo)
Returns the amount of space taken by all cargo types in a CargoAPI.

Parameters:
cargo - The CargoAPI to analyze.
Returns:
The amount of space used in cargo.
Since:
1.2

LazyLib