v0.6.5: updated version info, dropped support for pre-0.6.0b saves
This commit is contained in:
parent
bd43201e95
commit
2cf3a16feb
|
@ -103,8 +103,8 @@ public class GamesInProgress {
|
|||
info.slot = slot;
|
||||
Dungeon.preview(info, bundle);
|
||||
|
||||
//saves from before 0.5.0b are not supported
|
||||
if (info.version < ShatteredPixelDungeon.v0_5_0b) {
|
||||
//saves from before 0.6.0b are not supported
|
||||
if (info.version < ShatteredPixelDungeon.v0_6_0b) {
|
||||
info = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,44 +40,20 @@ import javax.microedition.khronos.opengles.GL10;
|
|||
public class ShatteredPixelDungeon extends Game {
|
||||
|
||||
//variable constants for specific older versions of shattered, used for data conversion
|
||||
//versions older than v0.5.0b are no longer supported, and data from them is ignored
|
||||
public static final int v0_5_0b = 159;
|
||||
|
||||
//versions older than v0.6.0b are no longer supported, and data from them is ignored
|
||||
public static final int v0_6_0b = 185;
|
||||
|
||||
public static final int v0_6_1b = 209;
|
||||
|
||||
public static final int v0_6_2e = 229;
|
||||
|
||||
public static final int v0_6_3c = 245;
|
||||
public static final int v0_6_3b = 245;
|
||||
|
||||
public static final int v0_6_4 = 251;
|
||||
public static final int v0_6_4a = 252;
|
||||
|
||||
public ShatteredPixelDungeon() {
|
||||
super( WelcomeScene.class );
|
||||
|
||||
//v0.6.0
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.MassGraveRoom.Bones.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.levels.painters.MassGravePainter$Bones" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.RitualSiteRoom.RitualMarker.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.levels.painters.RitualSitePainter$RitualMarker" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.WeakFloorRoom.HiddenWell.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.levels.painters.WeakFloorPainter$HiddenWell" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.levels.Room" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Shortsword.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.NewShortsword" );
|
||||
|
||||
//v0.6.0a
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.items.food.OverpricedRation" );
|
||||
|
||||
//v0.6.2
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret.RatKingRoom.class,
|
||||
|
|
|
@ -285,8 +285,8 @@ public abstract class Level implements Bundlable {
|
|||
|
||||
version = bundle.getInt( VERSION );
|
||||
|
||||
//saves from before 0.5.0b are not supported
|
||||
if (version < ShatteredPixelDungeon.v0_5_0b){
|
||||
//saves from before 0.6.0b are not supported
|
||||
if (version < ShatteredPixelDungeon.v0_6_0b){
|
||||
throw new RuntimeException("old save");
|
||||
}
|
||||
|
||||
|
|
|
@ -203,9 +203,6 @@ public abstract class RegularLevel extends Level {
|
|||
for (int i = 0; i < ((StandardRoom) room).sizeCat.roomValue; i++) {
|
||||
stdRooms.add(room);
|
||||
}
|
||||
//pre-0.6.0 save compatibility
|
||||
} else if (room.legacyType.equals("STANDARD")){
|
||||
stdRooms.add(room);
|
||||
}
|
||||
}
|
||||
Random.shuffle(stdRooms);
|
||||
|
@ -391,9 +388,7 @@ public abstract class RegularLevel extends Level {
|
|||
protected Room randomRoom( Class<?extends Room> type ) {
|
||||
Random.shuffle( rooms );
|
||||
for (Room r : rooms) {
|
||||
if (type.isInstance(r)
|
||||
//compatibility with pre-0.6.0 saves
|
||||
|| (type == StandardRoom.class && r.legacyType.equals("STANDARD"))) {
|
||||
if (type.isInstance(r)) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
//Note that this class should be treated as if it were abstract
|
||||
// it is currently not abstract to maintain compatibility with pre-0.6.0 saves
|
||||
// TODO make this class abstract after dropping support for pre-0.6.0 saves
|
||||
public class Room extends Rect implements Graph.Node, Bundlable {
|
||||
public abstract class Room extends Rect implements Graph.Node, Bundlable {
|
||||
|
||||
public ArrayList<Room> neigbours = new ArrayList<Room>();
|
||||
public LinkedHashMap<Room, Door> connected = new LinkedHashMap<Room, Door>();
|
||||
|
|
Loading…
Reference in New Issue
Block a user