1package com.fs.starfarer.api.campaign;
3import java.util.ArrayList;
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.campaign.CampaignUIAPI.CoreUITradeMode;
8import com.fs.starfarer.api.campaign.CargoAPI.CargoItemType;
9import com.fs.starfarer.api.campaign.econ.MarketAPI;
10import com.fs.starfarer.api.campaign.econ.SubmarketAPI;
11import com.fs.starfarer.api.fleet.FleetMemberAPI;
12import com.fs.starfarer.api.impl.campaign.shared.PlayerTradeDataForSubmarket;
16 public static class ShipSaleInfo {
29 public float getPrice() {
32 public void setPrice(
float price) {
37 public static enum LineItemType {
42 public static class TransactionLineItem {
44 private LineItemType itemType;
45 private CargoItemType cargoType;
47 private float quantity;
50 private float demandPrice;
51 private float demandTariff;
52 private long timestamp;
53 public TransactionLineItem(String
id, LineItemType itemType,
55 float quantity,
float price,
float tariff,
long timestamp) {
57 this.itemType = itemType;
58 this.cargoType = cargoType;
59 this.submarket = submarket;
60 this.quantity = quantity;
63 this.timestamp = timestamp;
69 public float getDemandPrice() {
72 public void setDemandPrice(
float price2) {
73 this.demandPrice = price2;
75 public float getDemandTariff() {
78 public void setDemandTariff(
float demandTariff) {
79 this.demandTariff = demandTariff;
81 public float getTariff() {
84 public void setTariff(
float tariff) {
91 this.submarket = submarket;
93 public String getId() {
96 public void setId(String
id) {
99 public LineItemType getItemType() {
102 public void setItemType(LineItemType itemType) {
103 this.itemType = itemType;
105 public CargoItemType getCargoType() {
108 public void setCargoType(CargoItemType cargoType) {
109 this.cargoType = cargoType;
111 public float getQuantity() {
114 public void setQuantity(
float quantity) {
115 this.quantity = quantity;
117 public float getPrice() {
120 public void setPrice(
float price) {
123 public long getTimestamp() {
126 public void setTimestamp(
long timestamp) {
127 this.timestamp = timestamp;
131 private float creditValue;
135 private List<TransactionLineItem> lineItems =
new ArrayList<TransactionLineItem>();
140 private List<ShipSaleInfo> shipsBought =
new ArrayList<ShipSaleInfo>();
141 private List<ShipSaleInfo> shipsSold =
new ArrayList<ShipSaleInfo>();
142 private final CoreUITradeMode tradeMode;
145 this.market = market;
146 this.submarket = submarket;
147 this.tradeMode = tradeMode;
166 float qty = stack.getSize();
170 stack.getType(), stack.getData(), stack.getBaseValuePerUnit(), qty);
175 float qty = stack.getSize();
183 stack.getType(), stack.getData(), stack.getBaseValuePerUnit(), qty);
200 this.creditValue = creditValue;
206 this.bought = bought;
static FactoryAPI getFactory()
SubmarketAPI getSubmarket()
void setSold(CargoAPI sold)
CoreUITradeMode getTradeMode()
List< ShipSaleInfo > getShipsSold()
List< ShipSaleInfo > getShipsBought()
List< TransactionLineItem > getLineItems()
float getQuantityBought(String commodityId)
float getQuantitySold(String commodityId)
void setBought(CargoAPI bought)
float getBaseTradeValueImpact()
PlayerMarketTransaction(MarketAPI market, SubmarketAPI submarket, CoreUITradeMode tradeMode)
void setCreditValue(float creditValue)
static float computeImpactOfHavingAlreadySold(MarketAPI market, CargoItemType type, Object data, float baseValue, float qty)
static float computeImpactOfHavingAlreadyBought(MarketAPI market, CargoItemType type, Object data, float baseValue, float qty)
CargoAPI createCargo(boolean unlimitedStacks)
float getQuantity(CargoAPI.CargoItemType type, Object data)
List< CargoStackAPI > getStacksCopy()