|
3 | 3 | import bwapi.ClientData.Command; |
4 | 4 | import bwapi.ClientData.GameData; |
5 | 5 | import bwapi.ClientData.Shape; |
6 | | -import bwapi.ClientData.UnitData; |
| 6 | + |
7 | 7 | import java.util.*; |
8 | 8 | import java.util.stream.Collectors; |
9 | 9 | import java.util.stream.IntStream; |
@@ -141,13 +141,13 @@ void init() { |
141 | 141 | final int bulletCount = 100; |
142 | 142 | bullets = new Bullet[bulletCount]; |
143 | 143 | for (int id = 0; id < bulletCount; id++) { |
144 | | - bullets[id] = new Bullet(gameData.getBullets(id), this); |
| 144 | + bullets[id] = new Bullet(gameData.getBullets(id), id,this); |
145 | 145 | } |
146 | 146 |
|
147 | 147 | final int regionCount = gameData.getRegionCount(); |
148 | 148 | regions = new Region[regionCount]; |
149 | 149 | for (int id = 0; id < regionCount; id++) { |
150 | | - regions[id] = new Region(gameData.getRegions(id), this); |
| 150 | + regions[id] = new Region(gameData.getRegions(id),this); |
151 | 151 | } |
152 | 152 |
|
153 | 153 | for (final Region region : regions) { |
@@ -373,7 +373,7 @@ public Region getRegion(final int regionID) { |
373 | 373 | } |
374 | 374 |
|
375 | 375 | public GameType getGameType() { |
376 | | - return GameType.gameTypes[gameData.getGameType()]; |
| 376 | + return GameType.idToEnum[gameData.getGameType()]; |
377 | 377 | } |
378 | 378 |
|
379 | 379 | public int getLatency() { |
@@ -429,11 +429,11 @@ public void pingMinimap(final Position p) { |
429 | 429 | } |
430 | 430 |
|
431 | 431 | public boolean isFlagEnabled(final Flag flag) { |
432 | | - return gameData.getFlags(flag.value); |
| 432 | + return gameData.getFlags(flag.id); |
433 | 433 | } |
434 | 434 |
|
435 | 435 | public void enableFlag(final Flag flag) { |
436 | | - addCommand(EnableFlag, flag.value, 1); |
| 436 | + addCommand(EnableFlag, flag.id, 1); |
437 | 437 | } |
438 | 438 |
|
439 | 439 | public List<Unit> getUnitsOnTile(final int tileX, final int tileY) { |
@@ -1114,7 +1114,7 @@ public List<Player> observers() { |
1114 | 1114 |
|
1115 | 1115 | public void drawText(final CoordinateType ctype, final int x, final int y, final String cstr_format) { |
1116 | 1116 | final int stringId = client.addString(cstr_format); |
1117 | | - addShape(ShapeType.Text, ctype, x, y, 0, 0, stringId, textSize.value, 0, false); |
| 1117 | + addShape(ShapeType.Text, ctype, x, y, 0, 0, stringId, textSize.id, 0, false); |
1118 | 1118 | } |
1119 | 1119 |
|
1120 | 1120 | public void drawTextMap(final int x, final int y, final String cstr_format) { |
|
0 commit comments