v3.3.2: moved custom vault rooms into proper static class definitions
This prevents internal error spam when attempting to initialize these rooms when loading the vault tester area
This commit is contained in:
@@ -47,11 +47,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class VaultLevel extends CityLevel {
|
public class VaultLevel extends CityLevel {
|
||||||
|
|
||||||
@Override
|
public static class VaultEntrance extends EntranceRoom {
|
||||||
protected ArrayList<Room> initRooms() {
|
|
||||||
ArrayList<Room> initRooms = new ArrayList<>();
|
|
||||||
|
|
||||||
initRooms.add(roomEntrance = new EntranceRoom(){
|
|
||||||
@Override
|
@Override
|
||||||
public int maxConnections(int direction) {
|
public int maxConnections(int direction) {
|
||||||
if (direction == LEFT || direction == TOP) return 0;
|
if (direction == LEFT || direction == TOP) return 0;
|
||||||
@@ -62,18 +58,16 @@ public class VaultLevel extends CityLevel {
|
|||||||
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 23; i++){
|
public static class VaultSegmentedRoom extends SegmentedRoom {
|
||||||
initRooms.add(new SegmentedRoom(){
|
|
||||||
@Override
|
@Override
|
||||||
public float[] sizeCatProbs() {
|
public float[] sizeCatProbs() {
|
||||||
return new float[]{1, 0, 0};
|
return new float[]{1, 0, 0};
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initRooms.add(new RegionDecoLineRoom(){
|
public static class VaultRegionDecoLineRoom extends RegionDecoLineRoom{
|
||||||
@Override
|
@Override
|
||||||
public float[] sizeCatProbs() {
|
public float[] sizeCatProbs() {
|
||||||
return new float[]{0, 0, 1};
|
return new float[]{0, 0, 1};
|
||||||
@@ -89,11 +83,28 @@ public class VaultLevel extends CityLevel {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceItem(Point p, Level l) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
public boolean canMerge(Level l, Room other, Point p, int mergeTerrain) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ArrayList<Room> initRooms() {
|
||||||
|
ArrayList<Room> initRooms = new ArrayList<>();
|
||||||
|
|
||||||
|
initRooms.add(roomEntrance = new VaultEntrance());
|
||||||
|
|
||||||
|
for (int i = 0; i < 23; i++){
|
||||||
|
initRooms.add(new VaultSegmentedRoom());
|
||||||
|
}
|
||||||
|
|
||||||
|
initRooms.add(new VaultRegionDecoLineRoom());
|
||||||
|
|
||||||
return initRooms;
|
return initRooms;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user