DEADSOFTWARE

Fix codestyle
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / WorldGen.java
index faacb252ba36fd2dfd06b8f5c748d44203742a3d..4c9b9b23f68a1bfb823e44a1baffb087084a4b1b 100644 (file)
@@ -3,7 +3,7 @@ package ru.deadsoftware.cavedroid.game;
 import com.badlogic.gdx.math.RandomXS128;
 import com.badlogic.gdx.utils.TimeUtils;
 
-public class WorldGen {
+class WorldGen {
 
     private static RandomXS128 rand;
     private static long seed;
@@ -23,23 +23,36 @@ public class WorldGen {
         res[0] = mid;
         for (int i = 1; i < width; i++) {
             t = rand.nextInt(7) - 3;
-            if (t > -3 && t < 3) t = 0;
-            else t /= Math.abs(t);
+            if (t > -3 && t < 3) {
+                t = 0;
+            } else {
+                t /= Math.abs(t);
+            }
             if (i > width - (max - min)) {
-                if (res[i - 1] + t < res[0]) t = Math.abs(t);
-                else if (res[i - 1] + t > res[0]) t = -Math.abs(t);
+                if (res[i - 1] + t < res[0]) {
+                    t = Math.abs(t);
+                } else if (res[i - 1] + t > res[0]) {
+                    t = -Math.abs(t);
+                }
             }
             res[i] = res[i - 1] + t;
-            if (res[i] < min) res[i] = min;
-            if (res[i] > max) res[i] = max;
-            if (i >= width / 2) {
-                bMap[i] = 1;
-                if (res[i] < 60) res[i] = 60;
-            } else {
-                bMap[i] = 0;
+            if (res[i] < min) {
+                res[i] = min;
+            }
+            if (res[i] > max) {
+                res[i] = max;
             }
+            bMap[i] = 0;
+//            if (i >= width / 2) {
+//                bMap[i] = 1;
+//                if (res[i] < 60) res[i] = 60;
+//            } else {
+//                bMap[i] = 0;
+//            }
+        }
+        if (res[0] < res[width - 1]) {
+            res[width - 1] = res[0];
         }
-        if (res[0] < res[width - 1]) res[width - 1] = res[0];
         return res;
     }