Small code improvements.
This commit is contained in:
@@ -59,7 +59,7 @@ public class GeoEngine
|
||||
* Returns the instance of the {@link GeoEngine}.
|
||||
* @return {@link GeoEngine} : The instance.
|
||||
*/
|
||||
public static final GeoEngine getInstance()
|
||||
public static GeoEngine getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ public class GeoEngine
|
||||
* @param worldX
|
||||
* @return int : Geo X
|
||||
*/
|
||||
public static final int getGeoX(int worldX)
|
||||
public static int getGeoX(int worldX)
|
||||
{
|
||||
return (MathUtil.limit(worldX, L2World.MAP_MIN_X, L2World.MAP_MAX_X) - L2World.MAP_MIN_X) >> 4;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class GeoEngine
|
||||
* @param worldY
|
||||
* @return int : Geo Y
|
||||
*/
|
||||
public static final int getGeoY(int worldY)
|
||||
public static int getGeoY(int worldY)
|
||||
{
|
||||
return (MathUtil.limit(worldY, L2World.MAP_MIN_Y, L2World.MAP_MAX_Y) - L2World.MAP_MIN_Y) >> 4;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class GeoEngine
|
||||
* @param geoX
|
||||
* @return int : World X
|
||||
*/
|
||||
public static final int getWorldX(int geoX)
|
||||
public static int getWorldX(int geoX)
|
||||
{
|
||||
return (MathUtil.limit(geoX, 0, GeoStructure.GEO_CELLS_X) << 4) + L2World.MAP_MIN_X + 8;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ public class GeoEngine
|
||||
* @param geoY
|
||||
* @return int : World Y
|
||||
*/
|
||||
public static final int getWorldY(int geoY)
|
||||
public static int getWorldY(int geoY)
|
||||
{
|
||||
return (MathUtil.limit(geoY, 0, GeoStructure.GEO_CELLS_Y) << 4) + L2World.MAP_MIN_Y + 8;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ public class GeoEngine
|
||||
* @param inside : 2D description of {@link IGeoObject}
|
||||
* @return byte[][] : Returns NSWE flags of {@link IGeoObject}.
|
||||
*/
|
||||
public static final byte[][] calculateGeoObject(boolean inside[][])
|
||||
public static byte[][] calculateGeoObject(boolean inside[][])
|
||||
{
|
||||
// get dimensions
|
||||
final int width = inside.length;
|
||||
@@ -1243,7 +1243,7 @@ public class GeoEngine
|
||||
* @param dirY : Y direction NSWE flag
|
||||
* @return byte : NSWE flag of combined direction
|
||||
*/
|
||||
private static final byte getDirXY(byte dirX, byte dirY)
|
||||
private static byte getDirXY(byte dirX, byte dirY)
|
||||
{
|
||||
// check axis directions
|
||||
if (dirY == GeoStructure.CELL_FLAG_N)
|
||||
|
@@ -170,7 +170,7 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
* @param target : the entry point
|
||||
* @return List<NodeLoc> : list of node location
|
||||
*/
|
||||
private static final List<Location> constructPath(Node target)
|
||||
private static List<Location> constructPath(Node target)
|
||||
{
|
||||
// create empty list
|
||||
LinkedList<Location> list = new LinkedList<>();
|
||||
|
@@ -151,7 +151,7 @@ public final class BlockComplexDynamic extends BlockComplex implements IBlockDyn
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized final void addGeoObject(IGeoObject object)
|
||||
final synchronized public void addGeoObject(IGeoObject object)
|
||||
{
|
||||
// add geo object, update block geodata when added
|
||||
if (_objects.add(object))
|
||||
@@ -161,7 +161,7 @@ public final class BlockComplexDynamic extends BlockComplex implements IBlockDyn
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized final void removeGeoObject(IGeoObject object)
|
||||
final synchronized public void removeGeoObject(IGeoObject object)
|
||||
{
|
||||
// remove geo object, update block geodata when removed
|
||||
if (_objects.remove(object))
|
||||
|
@@ -34,7 +34,7 @@ public class BlockMultilayer extends ABlock
|
||||
/**
|
||||
* Initializes the temporarily buffer.
|
||||
*/
|
||||
public static final void initialize()
|
||||
public static void initialize()
|
||||
{
|
||||
// initialize temporarily buffer and sorting mechanism
|
||||
_temp = ByteBuffer.allocate(GeoStructure.BLOCK_CELLS * MAX_LAYERS * 3);
|
||||
@@ -44,7 +44,7 @@ public class BlockMultilayer extends ABlock
|
||||
/**
|
||||
* Releases temporarily buffer.
|
||||
*/
|
||||
public static final void release()
|
||||
public static void release()
|
||||
{
|
||||
_temp = null;
|
||||
}
|
||||
|
@@ -196,7 +196,7 @@ public final class BlockMultilayerDynamic extends BlockMultilayer implements IBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized final void addGeoObject(IGeoObject object)
|
||||
final synchronized public void addGeoObject(IGeoObject object)
|
||||
{
|
||||
// add geo object, update block geodata when added
|
||||
if (_objects.add(object))
|
||||
@@ -206,7 +206,7 @@ public final class BlockMultilayerDynamic extends BlockMultilayer implements IBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized final void removeGeoObject(IGeoObject object)
|
||||
final synchronized public void removeGeoObject(IGeoObject object)
|
||||
{
|
||||
// remove geo object, update block geodata when removed
|
||||
if (_objects.remove(object))
|
||||
|
@@ -25,11 +25,11 @@ public interface IBlockDynamic
|
||||
* Adds {@link IGeoObject} to the {@link ABlock}. The block will update geodata according the object.
|
||||
* @param object : {@link IGeoObject} to be added.
|
||||
*/
|
||||
public void addGeoObject(IGeoObject object);
|
||||
void addGeoObject(IGeoObject object);
|
||||
|
||||
/**
|
||||
* Removes {@link IGeoObject} from the {@link ABlock}. The block will update geodata according the object.
|
||||
* @param object : {@link IGeoObject} to be removed.
|
||||
*/
|
||||
public void removeGeoObject(IGeoObject object);
|
||||
void removeGeoObject(IGeoObject object);
|
||||
}
|
@@ -25,29 +25,29 @@ public interface IGeoObject
|
||||
* Returns geodata X coordinate of the {@link IGeoObject}.
|
||||
* @return int : Geodata X coordinate.
|
||||
*/
|
||||
public int getGeoX();
|
||||
int getGeoX();
|
||||
|
||||
/**
|
||||
* Returns geodata Y coordinate of the {@link IGeoObject}.
|
||||
* @return int : Geodata Y coordinate.
|
||||
*/
|
||||
public int getGeoY();
|
||||
int getGeoY();
|
||||
|
||||
/**
|
||||
* Returns geodata Z coordinate of the {@link IGeoObject}.
|
||||
* @return int : Geodata Z coordinate.
|
||||
*/
|
||||
public int getGeoZ();
|
||||
int getGeoZ();
|
||||
|
||||
/**
|
||||
* Returns height of the {@link IGeoObject}.
|
||||
* @return int : Height.
|
||||
*/
|
||||
public int getHeight();
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Returns {@link IGeoObject} data.
|
||||
* @return byte[][] : {@link IGeoObject} data.
|
||||
*/
|
||||
public byte[][] getObjectGeoData();
|
||||
byte[][] getObjectGeoData();
|
||||
}
|
||||
|
Reference in New Issue
Block a user