1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
package gregtech.common.misc.spaceprojects.interfaces;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import gregtech.common.misc.spaceprojects.enums.SpaceBodyType;
import gregtech.common.misc.spaceprojects.enums.StarType;
import gregtech.common.misc.spaceprojects.enums.UpgradeStatus;
/**
* @author BlueWeabo
*/
public interface ISpaceProject {
/**
* @return the internal name of the project.
*/
String getProjectName();
/**
* @return Unlocalized name of the project.
*/
String getUnlocalizedName();
/**
* @return Localized name of the project using StatCollect#translateToLocal.
*/
String getLocalizedName();
/**
* @return The voltage the project requires to be built at. Used by the project manager.
*/
long getProjectVoltage();
/**
* @return The duration it takes to build out one(1) stage of the project. The time returned is in ticks
*/
int getProjectBuildTime();
/**
* @return The Current Progress of the project in percentage form. 1 being 100% and 0 being 0%.
*/
float getProjectCurrentProgress();
/**
* @return Currently unused, but this is the project's tier. Will be used to determine the min-tier motors needed on
* the Space Elevator
*/
int getProjectTier();
/**
* @return The Current stage of the project
*/
int getCurrentStage();
/**
* @return The Total amount of stages the project has
*/
int getTotalStages();
/**
* @return a Collection of all upgrades the project has
*/
Collection<ISP_Upgrade> getAllUpgrades();
/**
* @return a Map of all upgrades that have been built.
*/
Map<String, ISP_Upgrade> getUpgradesBuiltMap();
/**
* @return
*/
Collection<ISP_Upgrade> getAllBuiltUpgrades();
/**
* @param upgradeName The name of the upgrade wanted
* @return The upgrade with the appropriate name found in the available upgrades for the project
*/
ISP_Upgrade getUpgrade(String upgradeName);
/**
* @return The Items cost required per stage in an array form. Used for making the recipe.
*/
ItemStack[] getItemsCostPerStage();
/**
* @param index Index at which the itemstack is found at
* @return an item's cost at the appropriate index. Null otherwise if it goes above the index or there are no item
* costs
*/
ItemStack getItemCostPerStage(int index);
/**
* @return The Items current progress in an array form.
*/
ItemStack[] getCurrentItemsProgress();
/**
* @param index Index at which the itemstack is found at
* @return an item's current progress at the appropriate index. Null otherwise if it goes above the index or there
* are no item costs
*/
ItemStack getCurrentItemProgress(int index);
/**
* @return The items total cost required in an array form.
*/
ItemStack[] getTotalItemsCost();
/**
* @param index Index at which the itemstack is found at
* @return an item's total cost at the appropriate index. Null otherwise if it goes above the index or there are no
* item costs
*/
ItemStack getTotalItemCost(int index);
/**
* @return The fluids cost required per stage in an array form. Used for making the recipe.
*/
FluidStack[] getFluidsCostPerStage();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's cost at the appropriate index. Null otherwise if it goes above the index or there are no fluid
* costs
*/
FluidStack getFluidCostPerStage(int index);
/**
* @return The fluids current progress in an array form. Null if there are no fluid costs
*/
FluidStack[] getCurrentFluidsProgress();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's current progress at the appropriate index. Null otherwise if it goes above the index or there
* are no fluid costs
*/
FluidStack getCurrentFluidProgress(int index);
/**
* @return The fluids total cost required in an array form. Null if there are no fluid costs
*/
FluidStack[] getTotalFluidsCost();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's total cost at the appropriate index. Null otherwise if it goes above the index or there are no
* fluid costs
*/
FluidStack getTotalFluidCost(int index);
/**
* @return The current upgrade for this project, which is being built
*/
ISP_Upgrade getUpgradeBeingBuilt();
/**
* @return The location of the project
*/
ISpaceBody getProjectLocation();
/**
* @return The texture used in GUIs for the project
*/
UITexture getTexture();
/**
* Sets the current stage of the project
*/
void setProjectCurrentStage(int stage);
/**
* Sets the current upgrade, which needs to be built
*/
void setCurrentUpgradeBeingBuilt(ISP_Upgrade upgrade);
/**
* Sets the project's location when it starts being built
*/
void setProjectLocation(ISpaceBody newLocation);
/**
* Sets the project's upgrades, which have been built
*/
void setBuiltUpgrade(ISP_Upgrade... upgrades);
/**
* Goes to the next stage of the project
*/
void goToNextStage();
/**
* Creates a copy of the space project
*/
ISpaceProject copy();
/**
* Checks if the project meets all requirements with its current location
*
* @param team Team wanting said project and checking their projects
* @return true if all requirements met, false otherwise
*/
boolean meetsRequirements(UUID team);
/**
* Checks if the project meets requirements if it requires other projects, unless {@code checkLocation} is true,
* then it also checks for the location
*
* @param team Team wanting said project and checking their projects
* @param checkLocation If the location position should be checked
* @return true if all requirements met, false otherwise
*/
boolean meetsRequirements(UUID team, boolean checkLocation);
/**
* Checks if the projects is finished
*/
boolean isFinished();
/**
* Checks if the project has a certain upgrade installed or not
*
* @param upgradeName Upgrade being searched for
* @return True if that upgrade has been installed, false otherwise
*/
boolean hasUpgrade(String upgradeName);
/**
* @author BlueWeabo
*/
interface ISP_Upgrade {
/**
* @return internal name of the upgrade
*/
String getUpgradeName();
/**
* @return unlocalized name of the upgrade
*/
String getUnlocalizedName();
/**
* @return localized name of the upgrade
*/
String getLocalizedName();
/**
* @return The Items cost required per stage in an array form. Used for making the recipe.
*/
ItemStack[] getItemsCostPerStage();
/**
* @param index Index at which the itemstack is found at
* @return an item's cost at the appropriate index. Null otherwise if it goes above the index or there are no
* item costs
*/
ItemStack getItemCostPerStage(int index);
/**
* @return The Items current progress in an array form.
*/
ItemStack[] getCurrentItemsProgress();
/**
* @param index Index at which the itemstack is found at
* @return an item's current progress at the appropriate index. Null otherwise if it goes above the index or
* there are no item costs
*/
ItemStack getCurrentItemProgress(int index);
/**
* @return The items total cost required in an array form.
*/
ItemStack[] getTotalItemsCost();
/**
* @param index Index at which the itemstack is found at
* @return an item's total cost at the appropriate index. Null otherwise if it goes above the index or there are
* no item costs
*/
ItemStack getTotalItemCost(int index);
/**
* @return The fluids cost required per stage in an array form. Used for making the recipe.
*/
FluidStack[] getFluidsCostPerStage();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's cost at the appropriate index. Null otherwise if it goes above the index or there are no
* fluid costs
*/
FluidStack getFluidCostPerStage(int index);
/**
* @return The fluids current progress in an array form. Null if there are no fluid costs
*/
FluidStack[] getCurrentFluidsProgress();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's current progress at the appropriate index. Null otherwise if it goes above the index or
* there are no fluid costs
*/
FluidStack getCurrentFluidProgress(int index);
/**
* @return The fluids total cost required in an array form. Null if there are no fluid costs
*/
FluidStack[] getTotalFluidsCost();
/**
* @param index Index at which the fluidstack is found at
* @return a fluid's total cost at the appropriate index. Null otherwise if it goes above the index or there are
* no fluid costs
*/
FluidStack getTotalFluidCost(int index);
/**
* @return the total stages an upgrade has
*/
int getTotalStages();
/**
* @return the build time for the upgrade to go to its next stage
*/
int getUpgradeBuildTime();
/**
* @return current stage of the upgrade
*/
int getCurrentStage();
/**
* @return The Current Progress of the upgrade in percentage form. 1 being 100% and 0 being 0%.
*/
float getCurrentProgress();
/**
* @return The voltage at which the upgrade requires to be build at.
*/
long getVoltage();
/**
* Unused, unsure if it will get a sure
*/
UpgradeStatus getStatus();
/**
* @return the requirements the upgrade has
*/
ISP_Requirements getUpgradeRequirements();
/**
* @return the parent project, which the upgrade belongs to
*/
ISpaceProject getParentProject();
/**
* @param project The project the upgrade belongs to
*/
void setUpgradeProject(ISpaceProject project);
/**
* Sets the current stage of the upgrade
*
* @param stage
*/
void setUpgradeCurrentStage(int stage);
/**
* Checks if the team has met all requirements to be able to build said upgrade
*
* @param team The one starting the upgrade
* @return true if all requirements are met, false otherwise
*/
boolean meetsRequirements(UUID team);
/**
* Creates a copy of the upgrade
*/
ISP_Upgrade copy();
/**
* Goes to the next stage of the upgrade
*/
void goToNextStage();
/**
* @return true if the upgrade has finished all of its stages, false otherwise
*/
boolean isFinished();
}
/**
* @author BlueWeabo
*/
interface ISP_Requirements {
/**
* @return Space Body Type required by the project/upgrade
*/
SpaceBodyType getBodyType();
/**
* @return Star Type required by the project/upgrade
*/
StarType getStarType();
/**
* @return a list of all project required for the team to have to unlock it
*/
List<ISpaceProject> getProjects();
/**
* @return a list of all upgrades an upgrade can have as required.
*/
List<ISP_Upgrade> getUpgrades();
}
}
|