Package com.fs.starfarer.api.campaign
Interface CargoStackAPI
public interface CargoStackAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(float quantity) int
getCargo()
float
float
Returns null if it's not a commodity stack.getData()
Usually a String.float
getFree()
float
Returns a new instance of the plugin.float
getSize()
getType()
boolean
boolean
boolean
boolean
boolean
isFull()
boolean
boolean
boolean
Deprecated.boolean
isNull()
If true, it's an empty cargo stack.boolean
boolean
boolean
Deprecated.boolean
boolean
boolean
void
void
setPickedUp
(boolean isPickedUp) void
setSize
(float size) void
void
subtract
(float quantity)
-
Method Details
-
isWeaponStack
boolean isWeaponStack() -
isResourceStack
Deprecated.Use isCommodityStack() instead.- Returns:
-
isCommodityStack
boolean isCommodityStack() -
isMarineStack
boolean isMarineStack() -
isFuelStack
boolean isFuelStack() -
isSupplyStack
boolean isSupplyStack() -
isCrewStack
boolean isCrewStack() -
isPersonnelStack
boolean isPersonnelStack() -
getCommodityId
String getCommodityId()Returns null if it's not a commodity stack.- Returns:
-
getCargoSpace
float getCargoSpace() -
getCargoSpacePerUnit
float getCargoSpacePerUnit() -
getSize
float getSize() -
getFree
float getFree() -
setSize
void setSize(float size) -
add
void add(float quantity) -
subtract
void subtract(float quantity) -
getMaxSize
float getMaxSize() -
isFull
boolean isFull() -
getType
CargoAPI.CargoItemType getType() -
setType
-
isNull
boolean isNull()If true, it's an empty cargo stack. These get created for spacing, a result of the player moving cargo around.- Returns:
-
getData
Object getData()Usually a String. Its contents (i.e. the resource id) is how you can tell apart different types of resources.- Returns:
-
getDisplayName
String getDisplayName() -
getCargo
CargoAPI getCargo()- Returns:
- CargoAPI that contains this stack.
-
getBaseValuePerUnit
int getBaseValuePerUnit() -
getWeaponSpecIfWeapon
WeaponSpecAPI getWeaponSpecIfWeapon() -
isModSpecStack
Deprecated.Call isSpecialStack() and check specialData.getId().equals(Items.MODSPEC) instead.- Returns:
-
isFighterWingStack
boolean isFighterWingStack() -
getFighterWingSpecIfWing
FighterWingSpecAPI getFighterWingSpecIfWing() -
getHullModSpecIfHullMod
HullModSpecAPI getHullModSpecIfHullMod() -
getResourceIfResource
CommoditySpecAPI getResourceIfResource() -
isSpecialStack
boolean isSpecialStack() -
getSpecialDataIfSpecial
SpecialItemData getSpecialDataIfSpecial() -
getSpecialItemSpecIfSpecial
SpecialItemSpecAPI getSpecialItemSpecIfSpecial() -
getPlugin
SpecialItemPlugin getPlugin()Returns a new instance of the plugin. The special item plugin is transient and many instances may be in existence at any time - i.e. one for rendering the item in cargo, one for creating the tooltip, one for executing a right-click action, etc.- Returns:
-
setCargo
-
isInPlayerCargo
boolean isInPlayerCargo() -
isPickedUp
boolean isPickedUp() -
setPickedUp
void setPickedUp(boolean isPickedUp)
-