@@ -30,23 +30,19 @@ final class AreaInitializer extends Area {
3030 private static final StaticMarkable staticMarkable = new StaticMarkable ();
3131 private final Markable markable ;
3232
33- private final BWMap map ;
34-
3533 AreaInitializer (
3634 final BWMap map , final AreaId areaId , final WalkPosition top , final int miniTileCount ) {
37- super (areaId , top , miniTileCount );
38-
39- this .map = map ;
35+ super (areaId , top , miniTileCount , map );
4036
4137 this .markable = new Markable (staticMarkable );
4238
4339 if (!(areaId .intValue () > 0 )) {
44- throw new IllegalArgumentException ( );
40+ map . asserter . throwIllegalStateException ( "" );
4541 }
4642
4743 final MiniTile topMiniTile = this .map .getData ().getMiniTile (top );
4844 if (!(topMiniTile .getAreaId ().equals (areaId ))) {
49- throw new IllegalStateException (
45+ map . asserter . throwIllegalStateException (
5046 "assert failed: topMiniTile.AreaId().equals(areaId): expected: "
5147 + topMiniTile .getAreaId ().intValue ()
5248 + ", actual: "
@@ -66,7 +62,7 @@ Markable getMarkable() {
6662
6763 void addChokePoints (final Area area , final List <ChokePoint > chokePoints ) {
6864 if (!(super .chokePointsByArea .get (area ) == null && chokePoints != null )) {
69- throw new IllegalArgumentException ( );
65+ map . asserter . throwIllegalStateException ( "" );
7066 }
7167
7268 super .chokePointsByArea .put (area , chokePoints );
@@ -76,14 +72,14 @@ void addChokePoints(final Area area, final List<ChokePoint> chokePoints) {
7672
7773 void addMineral (final Mineral mineral ) {
7874 if (!(mineral != null && !super .minerals .contains (mineral ))) {
79- throw new IllegalStateException ( );
75+ map . asserter . throwIllegalStateException ( "" );
8076 }
8177 super .minerals .add (mineral );
8278 }
8379
8480 void addGeyser (final Geyser geyser ) {
8581 if (!(geyser != null && !super .geysers .contains (geyser ))) {
86- throw new IllegalStateException ( );
82+ map . asserter . throwIllegalStateException ( "" );
8783 }
8884 super .geysers .add (geyser );
8985 }
@@ -121,7 +117,7 @@ void setGroupId(int gid) {
121117
122118 int [] computeDistances (final ChokePoint startCP , final List <ChokePoint > targetCPs ) {
123119 if (targetCPs .contains (startCP )) {
124- throw new IllegalStateException ( );
120+ map . asserter . throwIllegalStateException ( "" );
125121 }
126122
127123 final TilePosition start =
@@ -168,7 +164,7 @@ private int[] computeDistances(final TilePosition start, final List<TilePosition
168164 final TilePosition current = distanceAndTilePosition .getRight ();
169165 final Tile currentTile = this .map .getData ().getTile (current , CheckMode .NO_CHECK );
170166 if (!(currentTile .getInternalData () == currentDist )) {
171- throw new IllegalStateException (
167+ map . asserter . throwIllegalStateException (
172168 "currentTile.InternalData().intValue()="
173169 + currentTile .getInternalData ()
174170 + ", currentDist="
@@ -216,7 +212,7 @@ private int[] computeDistances(final TilePosition start, final List<TilePosition
216212 toVisit .remove (
217213 new Pair <>(nextTile .getInternalData (), next ));
218214 if (!removed ) {
219- throw new IllegalStateException ( );
215+ map . asserter . throwIllegalStateException ( "" );
220216 }
221217 nextTile .setInternalData (newNextDist );
222218 toVisit .offer (new Pair <>(newNextDist , next ));
@@ -232,7 +228,7 @@ private int[] computeDistances(final TilePosition start, final List<TilePosition
232228 }
233229
234230 if (!(remainingTargets == 0 )) {
235- throw new IllegalStateException ( );
231+ map . asserter . throwIllegalStateException ( "" );
236232 }
237233
238234 for (final Pair <Integer , TilePosition > distanceAndTilePosition : toVisit ) {
@@ -452,7 +448,7 @@ void createBases(final TerrainData terrainData) {
452448 break ;
453449 }
454450
455- super .bases .add (new Base (this , bestLocation , assignedResources , blockingMinerals ));
451+ super .bases .add (new Base (this , bestLocation , assignedResources , blockingMinerals , map . asserter ));
456452 }
457453 }
458454
@@ -532,7 +528,7 @@ private boolean validateBaseLocation(
532528
533529 public void onMineralDestroyed (final Mineral mineral ) {
534530 if (mineral == null ) {
535- throw new IllegalArgumentException ( );
531+ map . asserter . throwIllegalStateException ( "" );
536532 }
537533
538534 this .minerals .remove (mineral );
0 commit comments