Starsector API
Loading...
Searching...
No Matches
TradeDisruption.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.econ;
2
3
8
9 public TradeDisruption() {
10 }
11
12 public void apply(String id) {
13// for (AffectedCommodity com : event.getDisruptedCommodities()) {
14// com.commodity.removeFromAverageStockpile(com.disruptionQuantity);
15// com.commodity.setAverageStockpileAfterDemand(0f);
16// }
17// for (AffectedCommodity com : event.getDisruptedCommodities()) {
18// com.commodity.getPlayerPriceMod().modifyPercent(id, com.pricePercent);
19// com.commodity.getPlayerPriceMod().modifyFlat(id, com.priceFlat);
20// }
21 }
22
23 public void unapply(String id) {
24// for (AffectedCommodity com : event.getDisruptedCommodities()) {
25// float dq = Math.min(com.disruptionQuantity, com.preDisruptionStockpile - com.commodity.getAverageStockpile());
26// if (dq < 0) dq = 0;
27// com.commodity.addToAverageStockpile(dq);
28// com.disruptionQuantity = dq;
29// }
30// for (CommodityOnMarketAPI com : market.getAllCommodities()) {
31// com.getPlayerPriceMod().unmodify(id);
32// }
33 }
34
35
36 @Override
37 public boolean isTransient() {
38 return false;
39 }
40}
41
42
43
44
45