Starsector API
Loading...
Searching...
No Matches
BoostIndustryInstallableItemEffect.java
Go to the documentation of this file.
1
4package com.fs.starfarer.api.impl.campaign.econ.impl;
5
6import com.fs.starfarer.api.campaign.econ.Industry;
7import com.fs.starfarer.api.util.Misc;
8
10
11 protected int supplyIncrease = 0;
12 protected int demandIncrease = 0;
13
15 super(id);
16 this.supplyIncrease = supplyIncrease;
17 this.demandIncrease = demandIncrease;
18 }
19
20 public void apply(Industry industry) {
21 if (supplyIncrease != 0) {
22 industry.getSupplyBonus().modifyFlat(spec.getId(), supplyIncrease,
23 Misc.ucFirst(spec.getName().toLowerCase()));
24 }
25 if (demandIncrease != 0) {
26 industry.getDemandReduction().modifyFlat(spec.getId(), -demandIncrease,
27 Misc.ucFirst(spec.getName().toLowerCase()));
28 }
29 }
30 public void unapply(Industry industry) {
31 if (supplyIncrease != 0) {
32 industry.getSupplyBonus().modifyFlat(spec.getId(), 0,
33 Misc.ucFirst(spec.getName().toLowerCase()));
34 }
35 if (demandIncrease != 0) {
36 industry.getDemandReduction().modifyFlat(spec.getId(), 0,
37 Misc.ucFirst(spec.getName().toLowerCase()));
38 }
39 }
40
41 public int getSupplyIncrease() {
42 return supplyIncrease;
43 }
44
46 this.supplyIncrease = supplyIncrease;
47 }
48
49 public int getDemandIncrease() {
50 return demandIncrease;
51 }
52
54 this.demandIncrease = demandIncrease;
55 }
56
57
58// public void addItemDescription(TooltipMakerAPI text, SpecialItemData data, InstallableItemDescriptionMode mode) {
59// }
60
61}
62
63
64
65
66
67