Skip to content

Commit f627403

Browse files
committed
Merge branch 'develop' of https://github.com/JavaBWAPI/JBWAPI into develop
2 parents 010e26c + d8a66dc commit f627403

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/bwapi/Player.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ public class Player implements Comparable<Player> {
2323
private final Game game;
2424
private final int id;
2525
private final String name;
26-
private final Race race;
2726
private final PlayerType playerType;
28-
private final Force force;
2927
private final TilePosition startLocation;
3028

3129
private PlayerSelf self = null;
@@ -41,9 +39,7 @@ PlayerSelf self() {
4139
this.game = game;
4240
this.id = id;
4341
this.name = playerData.getName();
44-
this.race = Race.idToEnum[playerData.getRace()];
4542
this.playerType = PlayerType.idToEnum[playerData.getType()];
46-
this.force = game.getForce(playerData.getForce());
4743
this.startLocation = new TilePosition(playerData.getStartLocationX(), playerData.getStartLocationY());
4844
}
4945

@@ -88,7 +84,7 @@ public List<Unit> getUnits() {
8884
* have not been seen.
8985
*/
9086
public Race getRace() {
91-
return race;
87+
return Race.idToEnum[playerData.getRace()];
9288
}
9389

9490
/**
@@ -110,7 +106,7 @@ public PlayerType getType() {
110106
* @return The {@link Force} object that the player is part of.
111107
*/
112108
public Force getForce() {
113-
return force;
109+
return game.getForce(playerData.getForce());
114110
}
115111

116112
/**

0 commit comments

Comments
 (0)