Skip to content

Commit 239e9ab

Browse files
committed
last Set<T> to List<T> conversions I forgot
1 parent 7d8e52c commit 239e9ab

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

src/main/java/bwapi/Force.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package bwapi;
22

33
import bwapi.ClientData.ForceData;
4-
import java.util.Set;
4+
5+
import java.util.List;
56
import java.util.stream.Collectors;
67

78
public class Force {
@@ -24,10 +25,10 @@ public String getName() {
2425
return name;
2526
}
2627

27-
public Set<Player> getPlayers() {
28+
public List<Player> getPlayers() {
2829
return game.getPlayers().stream()
2930
.filter(p -> equals(p.getForce()))
30-
.collect(Collectors.toSet());
31+
.collect(Collectors.toList());
3132
}
3233

3334
public boolean equals(final Object that) {

src/main/java/bwapi/Player.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package bwapi;
22

33
import bwapi.ClientData.PlayerData;
4-
import java.util.Set;
4+
5+
import java.util.List;
56
import java.util.stream.Collectors;
67

78
import static bwapi.UnitType.*;
@@ -37,10 +38,10 @@ public String getName() {
3738
return name;
3839
}
3940

40-
public Set<Unit> getUnits() {
41+
public List<Unit> getUnits() {
4142
return game.getAllUnits().stream()
4243
.filter(u -> equals(u.getPlayer()))
43-
.collect(Collectors.toSet());
44+
.collect(Collectors.toList());
4445
}
4546

4647
public Race getRace() {

src/main/java/bwapi/Unit.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,13 @@ public Unit getTransport() {
435435
return game.getUnit(unitData.getTransport());
436436
}
437437

438-
public Set<Unit> getLoadedUnits() {
438+
public List<Unit> getLoadedUnits() {
439439
if (getType().spaceProvided() < 1) {
440-
return new HashSet<>();
440+
return new ArrayList<>();
441441
}
442442
return game.getAllUnits().stream()
443443
.filter(u -> equals(u.getTransport()))
444-
.collect(Collectors.toSet());
444+
.collect(Collectors.toList());
445445
}
446446

447447
public int getSpaceRemaining() {
@@ -458,26 +458,26 @@ public Unit getCarrier() {
458458
return game.getUnit(unitData.getCarrier());
459459
}
460460

461-
public Set<Unit> getInterceptors() {
461+
public List<Unit> getInterceptors() {
462462
if (getType() != Protoss_Carrier && getType() != Hero_Gantrithor) {
463-
return new HashSet<>();
463+
return new ArrayList<>();
464464
}
465465
return game.getAllUnits().stream()
466466
.filter(u -> equals(u.getCarrier()))
467-
.collect(Collectors.toSet());
467+
.collect(Collectors.toList());
468468
}
469469

470470
public Unit getHatchery() {
471471
return game.getUnit(unitData.getHatchery());
472472
}
473473

474-
public Set<Unit> getLarva() {
474+
public List<Unit> getLarva() {
475475
if (!getType().producesLarva()) {
476-
return new HashSet<>();
476+
return new ArrayList<>();
477477
}
478478
return game.getAllUnits().stream()
479479
.filter(u -> equals(u.getHatchery()))
480-
.collect(Collectors.toSet());
480+
.collect(Collectors.toList());
481481
}
482482

483483
public List<Unit> getUnitsInRadius(final int radius) {

0 commit comments

Comments
 (0)