Starsector API
Loading...
Searching...
No Matches
CargoAPI.java
Go to the documentation of this file.
1package com.fs.starfarer.api.campaign;
2
3import java.util.List;
4
5import com.fs.starfarer.api.fleet.FleetMemberType;
6import com.fs.starfarer.api.util.MutableValue;
7
13public interface CargoAPI {
14
15 public static class CargoItemQuantity<T> {
16 T item;
17 int count;
18
19 public CargoItemQuantity(T item, int count) {
20 this.item = item;
21 this.count = count;
22 }
23
24 public int getCount() {
25 return count;
26 }
27
28 public T getItem() {
29 return item;
30 }
31 }
32
33// public static enum CrewXPLevel {
34// GREEN("green_crew", "icon_crew_green", "Green"),
35// REGULAR("regular_crew", "icon_crew_regular", "Regular"),
36// VETERAN("veteran_crew", "icon_crew_veteran", "Veteran"),
37// ELITE("elite_crew", "icon_crew_elite", "Elite");
38//
39// private String id;
40// private String rankIconKey;
41// private String prefix;
42// private CrewXPLevel(String id, String iconKey, String prefix) {
43// this.id = id;
44// this.rankIconKey = iconKey;
45// this.prefix = prefix;
46// }
47// public String getPrefix() {
48// return prefix;
49// }
50// public String getId() {
51// return id;
52// }
53// public String getRankIconKey() {
54// return rankIconKey;
55// }
56// }
57
58
59 public static enum CargoItemType {
60 RESOURCES,
61 WEAPONS,
62 FIGHTER_CHIP,
63 //MOD_SPEC, // replaced with SPECIAL and SpecialItemData.id for type; see Items class for possible values.
64 //BLUEPRINTS,
65 SPECIAL,
66 NULL,
67 }
68
69
70 List<CargoItemQuantity<String>> getWeapons();
71
72 int getNumWeapons(String id);
73 void removeWeapons(String id, int count);
74 void addWeapons(String id, int count);
75
76 float getSupplies();
77 float getFuel();
78
80 void addCrew(int quantity);
81 int getCrew();
83 void addMarines(int quantity);
84 void removeMarines(int quantity);
85
86 void addFuel(float quantity);
87 void removeFuel(float quantity);
88 void addSupplies(float quantity);
89 void removeSupplies(float quantity);
90 public void removeCrew(int quantity);
91
92 public void addItems(CargoAPI.CargoItemType itemType, Object data, float quantity);
93 public boolean removeItems(CargoAPI.CargoItemType itemType, Object data, float quantity);
94 public float getQuantity(CargoAPI.CargoItemType type, Object data);
95
96
97
98 public void addMothballedShip(FleetMemberType type, String variantOrWingId, String optionalName);
99
100 void initMothballedShips(String factionId);
106
107
108 public void clear();
109
115 @Deprecated public void setFreeTransfer(boolean freeTransfer);
116 @Deprecated public boolean isFreeTransfer();
117
118 public MutableValue getCredits();
119
120 public List<CargoStackAPI> getStacksCopy();
121
122 void gainCrewXP(float xp);
123
124 void sort();
125
126 float getMaxFuel();
129
132
133 boolean isEmpty();
134
136
138
139 void addCommodity(String commodityId, float quantity);
140
141 float getCommodityQuantity(String id);
142
144
145 void removeCommodity(String id, float quantity);
146
148
149 List<CargoItemQuantity<String>> getFighters();
150
151 int getNumFighters(String id);
152
153 void addAll(CargoAPI other);
154
155 void addFighters(String id, int count);
156
157 void addHullmods(String id, int count);
158
160
162
163 void addSpecial(SpecialItemData data, float quantity);
164
166
168
169 void removeAll(CargoAPI other);
170
171 void addAll(CargoAPI other, boolean includeMothballedShips);
172
174 void setOrigSource(CargoAPI origSource);
175
177
179
180 void removeFighters(String id, int count);
181
183 void setUnlimitedStacks(boolean unlimitedStacks);
184}
185
186
187
188
189
190
191
192
193
194
195
196
void removeFighters(String id, int count)
List< CargoItemQuantity< String > > getWeapons()
float getQuantity(CargoAPI.CargoItemType type, Object data)
void addAll(CargoAPI other, boolean includeMothballedShips)
void addHullmods(String id, int count)
void setFreeTransfer(boolean freeTransfer)
void addFromStack(CargoStackAPI stack)
void removeStack(CargoStackAPI stack)
void addMothballedShip(FleetMemberType type, String variantOrWingId, String optionalName)
void addWeapons(String id, int count)
boolean removeItems(CargoAPI.CargoItemType itemType, Object data, float quantity)
void removeWeapons(String id, int count)
void addSpecial(SpecialItemData data, float quantity)
void removeCommodity(String id, float quantity)
void setUnlimitedStacks(boolean unlimitedStacks)
void setOrigSource(CargoAPI origSource)
void initMothballedShips(String factionId)
List< CargoStackAPI > getStacksCopy()
void addItems(CargoAPI.CargoItemType itemType, Object data, float quantity)
List< CargoItemQuantity< String > > getFighters()
void addCommodity(String commodityId, float quantity)
void addFighters(String id, int count)