|
27 | 27 | import bwem.tile.TileImpl; |
28 | 28 | import bwem.typedef.Altitude; |
29 | 29 | import bwem.typedef.CPPath; |
30 | | -import bwem.typedef.Index; |
31 | 30 | import bwem.unit.Geyser; |
32 | 31 | import bwem.unit.Mineral; |
33 | 32 | import bwem.unit.Neutral; |
@@ -152,16 +151,16 @@ private List<ChokePoint> getChokePoints(final Area a, final Area b) { |
152 | 151 | // Returns the ground distance in pixels between cpA->center() and cpB>center() |
153 | 152 | public int distance(ChokePoint cpA, ChokePoint cpB) { |
154 | 153 | return chokePointDistanceMatrix |
155 | | - .get(((ChokePointImpl) cpA).getIndex().intValue()) |
156 | | - .get(((ChokePointImpl) cpB).getIndex().intValue()); |
| 154 | + .get(((ChokePointImpl) cpA).getIndex()) |
| 155 | + .get(((ChokePointImpl) cpB).getIndex()); |
157 | 156 | } |
158 | 157 |
|
159 | 158 | // Returns a list of getChokePoints, which is intended to be the shortest walking path from cpA to |
160 | 159 | // cpB. |
161 | 160 | public CPPath getPath(ChokePoint cpA, ChokePoint cpB) { |
162 | 161 | return pathsBetweenChokePoints |
163 | | - .get(((ChokePointImpl) cpA).getIndex().intValue()) |
164 | | - .get(((ChokePointImpl) cpB).getIndex().intValue()); |
| 162 | + .get(((ChokePointImpl) cpA).getIndex()) |
| 163 | + .get(((ChokePointImpl) cpB).getIndex()); |
165 | 164 | } |
166 | 165 |
|
167 | 166 | public CPPath getPath(final Position a, final Position b, final MutableInt pLength) { |
@@ -326,8 +325,7 @@ public void createChokePoints( |
326 | 325 | final List<StaticBuilding> staticBuildings, |
327 | 326 | final List<Mineral> minerals, |
328 | 327 | final List<Pair<Pair<AreaId, AreaId>, WalkPosition>> rawFrontier) { |
329 | | - Index newIndex = new Index(0); |
330 | | - |
| 328 | + int newIndex = 0; |
331 | 329 | final List<Neutral> blockingNeutrals = new ArrayList<>(); |
332 | 330 | for (final StaticBuilding s : staticBuildings) { |
333 | 331 | if (s.isBlocking()) { |
@@ -418,7 +416,7 @@ public void createChokePoints( |
418 | 416 | for (final List<WalkPosition> cluster : clusters) { |
419 | 417 | getChokePoints(a, b) |
420 | 418 | .add(new ChokePointImpl(this, newIndex, getArea(a), getArea(b), cluster)); |
421 | | - newIndex = newIndex.add(1); |
| 419 | + newIndex++; |
422 | 420 | } |
423 | 421 | } |
424 | 422 |
|
@@ -447,7 +445,7 @@ public void createChokePoints( |
447 | 445 | .add( |
448 | 446 | new ChokePointImpl( |
449 | 447 | this, newIndex, blockedAreaA, blockedAreaB, list, blockingNeutral)); |
450 | | - newIndex = newIndex.add(1); |
| 448 | + newIndex++; |
451 | 449 | } |
452 | 450 | } |
453 | 451 | } |
@@ -758,15 +756,15 @@ private void updateGroupIds() { |
758 | 756 | } |
759 | 757 |
|
760 | 758 | private void setDistance(final ChokePoint cpA, final ChokePoint cpB, final int value) { |
761 | | - final int indexA = ((ChokePointImpl) cpA).getIndex().intValue(); |
762 | | - final int indexB = ((ChokePointImpl) cpB).getIndex().intValue(); |
| 759 | + final int indexA = ((ChokePointImpl) cpA).getIndex(); |
| 760 | + final int indexB = ((ChokePointImpl) cpB).getIndex(); |
763 | 761 | this.chokePointDistanceMatrix.get(indexA).set(indexB, value); |
764 | 762 | this.chokePointDistanceMatrix.get(indexB).set(indexA, value); |
765 | 763 | } |
766 | 764 |
|
767 | 765 | private void setPath(final ChokePoint cpA, final ChokePoint cpB, final CPPath pathAB) { |
768 | | - final int indexA = ((ChokePointImpl) cpA).getIndex().intValue(); |
769 | | - final int indexB = ((ChokePointImpl) cpB).getIndex().intValue(); |
| 766 | + final int indexA = ((ChokePointImpl) cpA).getIndex(); |
| 767 | + final int indexB = ((ChokePointImpl) cpB).getIndex(); |
770 | 768 |
|
771 | 769 | this.pathsBetweenChokePoints.get(indexA).set(indexB, pathAB); |
772 | 770 |
|
|
0 commit comments