There is no need to store z value.

This commit is contained in:
MobiusDevelopment 2021-08-25 23:42:48 +00:00
parent 8fbaf94aa2
commit 3e26f8a27b
21 changed files with 21 additions and 42 deletions

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}

View File

@ -144,13 +144,12 @@ public class ZoneCylinder extends ZoneForm
final int y2 = _y - _rad;
final int x3 = _x + _rad;
final int y3 = _y + _rad;
final int z = (_z1 + _z2) / 2;
while ((Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) > _radS)
{
x = Rnd.get(x2, x3);
y = Rnd.get(y2, y3);
}
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, z));
return new Location(x, y, GeoEngine.getInstance().getHeight(x, y, (_z1 + _z2) / 2));
}
}