File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed
Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ public enum TechType {
191191 Arrays .stream (TechType .values ()).forEach (v -> idToEnum [v .id ] = v );
192192 }
193193
194- final int id ;
194+ public final int id ;
195195
196196 TechType (final int id ) {
197197 this .id = id ;
Original file line number Diff line number Diff line change @@ -835,14 +835,17 @@ public UnitType getBuildType() {
835835 * @see #isTraining
836836 */
837837 public List <UnitType > getTrainingQueue () {
838- return IntStream .range (0 , getTrainingQueueCount ())
839- .mapToObj (i -> game .isLatComEnabled () && self ().trainingQueue [i ].valid (game .getFrameCount ()) ?
840- self ().trainingQueue [i ].get () :
841- UnitType .idToEnum [unitData .getTrainingQueue (i )])
842- .collect (Collectors .toList ());
838+ return IntStream .range (0 , getTrainingQueueCount ()).mapToObj (this ::getTrainingQueueAt ).collect (Collectors .toList ());
839+ }
840+
841+ public UnitType getTrainingQueueAt (int i ) {
842+ if (game .isLatComEnabled () && self ().trainingQueue [i ].valid (game .getFrameCount ())) {
843+ return self ().trainingQueue [i ].get ();
844+ }
845+ return UnitType .idToEnum [unitData .getTrainingQueue (i )];
843846 }
844847
845- int getTrainingQueueCount () {
848+ public int getTrainingQueueCount () {
846849 int count = unitData .getTrainingQueueCount ();
847850 if (game .isLatComEnabled () && self ().trainingQueueCount .valid (game .getFrameCount ())) {
848851 return count + self ().trainingQueueCount .get ();
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ public enum UnitType {
252252 Arrays .stream (UnitType .values ()).forEach (v -> idToEnum [v .id ] = v );
253253 }
254254
255- final int id ;
255+ public final int id ;
256256
257257 UnitType (final int id ) {
258258 this .id = id ;
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ public enum UpgradeType {
205205 Arrays .stream (UpgradeType .values ()).forEach (v -> idToEnum [v .id ] = v );
206206 }
207207
208- final int id ;
208+ public final int id ;
209209
210210 UpgradeType (final int id ) {
211211 this .id = id ;
You can’t perform that action at this time.
0 commit comments