From 6b9be106355838efcc251b1722648dce24b45f0c Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 27 Sep 2021 21:48:19 -0500 Subject: [PATCH] Add a few missing comments and refactors to LodRegion --- .../lod/handlers/LodDimensionFileHandler.java | 4 +- .../com/seibel/lod/objects/LodRegion.java | 43 +++++++++++-------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java b/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java index ce5e0bff2..6256e423a 100644 --- a/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java +++ b/src/main/java/com/seibel/lod/handlers/LodDimensionFileHandler.java @@ -184,7 +184,7 @@ public class LodDimensionFileHandler // add the data to our region - switch (region.getLodQualityMode()) + switch (region.getVerticalQuality()) { default: case HEIGHTMAP: @@ -264,7 +264,7 @@ public class LodDimensionFileHandler { for (byte detailLevel = region.getMinDetailLevel(); detailLevel <= LodUtil.REGION_DETAIL_LEVEL; detailLevel++) { - String fileName = getFileNameAndPathForRegion(region.regionPosX, region.regionPosZ, region.getGenerationMode(), detailLevel, region.getLodQualityMode()); + String fileName = getFileNameAndPathForRegion(region.regionPosX, region.regionPosZ, region.getGenerationMode(), detailLevel, region.getVerticalQuality()); File oldFile = new File(fileName); // if the fileName was null that means the folder is inaccessible diff --git a/src/main/java/com/seibel/lod/objects/LodRegion.java b/src/main/java/com/seibel/lod/objects/LodRegion.java index 3b63bf1a6..2cee404a6 100644 --- a/src/main/java/com/seibel/lod/objects/LodRegion.java +++ b/src/main/java/com/seibel/lod/objects/LodRegion.java @@ -24,18 +24,26 @@ import com.seibel.lod.util.LodUtil; */ public class LodRegion { + /** TODO what does this represent, and should it be defined here? */ + private static final byte POSSIBLE_LOD = 10; + + /** Holds the lowest (least detailed) detail level in this region * TODO is that correct? */ private byte minDetailLevel; - private static final byte POSSIBLE_LOD = 10; + /** This holds all data for this region */ private LevelContainer[] dataContainer; - + /** the generation mode for this region + * TODO will this ever change through a region's life? */ private DistanceGenerationMode generationMode; + /** the vertical quality of this region */ private VerticalQuality verticalQuality; + /** this region's x RegionPos */ public final int regionPosX; + /** this region's z RegionPos */ public final int regionPosZ; @@ -77,21 +85,6 @@ public class LodRegion - public VerticalQuality getLodQualityMode() - { - return verticalQuality; - } - - public DistanceGenerationMode getGenerationMode() - { - return generationMode; - } - - public int getMaxVerticalData(byte detailLevel) - { - return dataContainer[detailLevel].getMaxVerticalData(); - } - /** * Inserts the data point into the region. * @@ -553,6 +546,22 @@ public class LodRegion return count; } + public VerticalQuality getVerticalQuality() + { + return verticalQuality; + } + + public DistanceGenerationMode getGenerationMode() + { + return generationMode; + } + + public int getMaxVerticalData(byte detailLevel) + { + return dataContainer[detailLevel].getMaxVerticalData(); + } + + @Override public String toString() {