Added dungeonData shell for saving
This commit is contained in:
@@ -66,7 +66,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
catch (IOException e)
|
||||
{
|
||||
// not sure if this is kosher, we need it to explode, but not by throwing the IO exception.
|
||||
throw new ConfigurationProcessingException();
|
||||
throw new ConfigurationProcessingException("Incorrectly formatted save data");
|
||||
}
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -86,6 +86,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
int PackDepth;
|
||||
int ParentID;
|
||||
int RootID;
|
||||
PackedDungeonData Dungeon;
|
||||
Point3D Origin;
|
||||
int Orientation;
|
||||
List<Integer> ChildIDs;
|
||||
@@ -121,6 +122,8 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
reader.nextName();
|
||||
RootID= reader.nextInt();
|
||||
|
||||
reader.nextName();
|
||||
Dungeon = createDungeonDataFromJson(reader);
|
||||
reader.nextName();
|
||||
Origin = createPointFromJson(reader);
|
||||
|
||||
@@ -133,7 +136,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
reader.nextName();
|
||||
Links = this.createLinksListFromJson(reader);
|
||||
|
||||
return new PackedDimData(ID, Depth, PackDepth, ParentID, RootID, Orientation, IsDungeon, IsFilled, Origin, ChildIDs, Links, Tails);
|
||||
return new PackedDimData(ID, Depth, PackDepth, ParentID, RootID, Orientation, IsDungeon, IsFilled, Dungeon, Origin, ChildIDs, Links, Tails);
|
||||
}
|
||||
|
||||
private Point3D createPointFromJson(JsonReader reader) throws IOException
|
||||
@@ -239,6 +242,9 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
||||
}
|
||||
private PackedDungeonData createDungeonDataFromJson(JsonReader reader) throws IOException
|
||||
{
|
||||
reader.beginObject();
|
||||
//TODO read in dungeon Data
|
||||
reader.endObject();
|
||||
return null;
|
||||
}
|
||||
private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException
|
||||
|
||||
@@ -16,6 +16,7 @@ public class PackedDimData
|
||||
public final int PackDepth;
|
||||
public final int ParentID;
|
||||
public final int RootID;
|
||||
public final PackedDungeonData DungeonData;
|
||||
public final Point3D Origin;
|
||||
public final int Orientation;
|
||||
public final List<Integer> ChildIDs;
|
||||
@@ -25,7 +26,7 @@ public class PackedDimData
|
||||
// FIXME Missing dungeon data, not sure how to include it
|
||||
|
||||
public PackedDimData(int id, int depth, int packDepth, int parentID, int rootID, int orientation,
|
||||
boolean isDungeon, boolean isFilled, Point3D origin, List<Integer> childIDs, List<PackedLinkData> links,
|
||||
boolean isDungeon, boolean isFilled,PackedDungeonData dungeonData, Point3D origin, List<Integer> childIDs, List<PackedLinkData> links,
|
||||
List<PackedLinkTail> tails)
|
||||
{
|
||||
ID = id;
|
||||
@@ -36,6 +37,7 @@ public class PackedDimData
|
||||
Orientation = orientation;
|
||||
IsDungeon = isDungeon;
|
||||
IsFilled = isFilled;
|
||||
DungeonData = dungeonData;
|
||||
Origin = origin;
|
||||
ChildIDs = childIDs;
|
||||
Links = links;
|
||||
|
||||
Reference in New Issue
Block a user