Skip to content

Commit 082f2a0

Browse files
committed
implement Player and Force
1 parent 2965a86 commit 082f2a0

File tree

10 files changed

+240
-108
lines changed

10 files changed

+240
-108
lines changed

src/main/java/bwapi/Force.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import JavaBWAPIBackend.Client.GameData.ForceData;
44

5-
import java.util.List;
5+
import java.util.Set;
6+
import java.util.stream.Collectors;
67

78
public class Force {
89
private final ForceData forceData;
@@ -21,8 +22,10 @@ public String getName() {
2122
return forceData.name();
2223
}
2324

24-
public List<Player> getPlayers() {
25-
return null;
25+
public Set<Player> getPlayers() {
26+
return game.getPlayers().stream()
27+
.filter(p -> this.equals(p.getForce()))
28+
.collect(Collectors.toSet());
2629
}
2730

2831
public boolean equals(Object that){

0 commit comments

Comments
 (0)