v0.7.0: removed leftover legacy room code from pre-0.6.0

This commit is contained in:
Evan Debenham 2018-06-24 22:20:27 -04:00
parent 6563576648
commit a282833a0e
2 changed files with 4 additions and 10 deletions

View File

@ -452,7 +452,7 @@ public abstract class RegularLevel extends Level {
public int fallCell( boolean fallIntoPit ) {
if (fallIntoPit) {
for (Room room : rooms) {
if (room instanceof PitRoom || room.legacyType.equals("PIT")) {
if (room instanceof PitRoom) {
int result;
do {
result = pointToCell(room.random());
@ -482,9 +482,9 @@ public abstract class RegularLevel extends Level {
rooms = new ArrayList<>( (Collection<Room>) ((Collection<?>) bundle.getCollection( "rooms" )) );
for (Room r : rooms) {
r.onLevelLoad( this );
if (r instanceof EntranceRoom || r.legacyType.equals("ENTRANCE")){
if (r instanceof EntranceRoom ){
roomEntrance = r;
} else if (r instanceof ExitRoom || r.legacyType.equals("EXIT")){
} else if (r instanceof ExitRoom ){
roomExit = r;
}
}

View File

@ -345,16 +345,12 @@ public abstract class Room extends Rect implements Graph.Node, Bundlable {
return edges;
}
public String legacyType = "NULL";
@Override
public void storeInBundle( Bundle bundle ) {
bundle.put( "left", left );
bundle.put( "top", top );
bundle.put( "right", right );
bundle.put( "bottom", bottom );
if (!legacyType.equals("NULL"))
bundle.put( "type", legacyType );
}
@Override
@ -363,11 +359,9 @@ public abstract class Room extends Rect implements Graph.Node, Bundlable {
top = bundle.getInt( "top" );
right = bundle.getInt( "right" );
bottom = bundle.getInt( "bottom" );
if (bundle.contains( "type" ))
legacyType = bundle.getString( "type" );
}
//Note that currently connections and neighbours are not preserved on load
//FIXME currently connections and neighbours are not preserved on load
public void onLevelLoad( Level level ){
//does nothing by default
}