v0.3.1a: floors now remember their entrance and exit rooms.

This commit is contained in:
Evan Debenham 2015-08-20 10:32:24 -04:00
parent 7b3c7aa46d
commit b2494fe76e
2 changed files with 7 additions and 1 deletions

View File

@ -738,12 +738,17 @@ public abstract class RegularLevel extends Level {
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
rooms = new HashSet<Room>( (Collection<Room>) ((Collection<?>) bundle.getCollection( "rooms" )) );
rooms = new HashSet<>( (Collection<Room>) ((Collection<?>) bundle.getCollection( "rooms" )) );
for (Room r : rooms) {
if (r.type == Type.WEAK_FLOOR) {
weakFloorCreated = true;
break;
}
if (r.type == Type.ENTRANCE){
roomEntrance = r;
} else if (r.type == Type.EXIT || r.type == Type.BOSS_EXIT){
roomExit = r;
}
}
}

View File

@ -281,6 +281,7 @@ public class SewerBossLevel extends RegularLevel {
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
stairs = bundle.getInt( STAIRS );
roomExit = roomEntrance;
}
@Override