Skip to content

Commit

Permalink
Add extent factory methods taking the extent min point
Browse files Browse the repository at this point in the history
  • Loading branch information
Deamon5550 committed Sep 30, 2017
1 parent 9f1af7e commit 6cb5c97
Showing 1 changed file with 116 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,21 @@ public interface ExtentBufferFactory {
/**
* Returns a new biome buffer of the desired size.
*
* @param size The size of the buffer on x and z (y in the vector)
* @param size The size of the buffer on x, y, and z.
* @return A new biome buffer
*/
MutableBiomeVolume createBiomeBuffer(Vector3i size);
default MutableBiomeVolume createBiomeBuffer(Vector3i size) {
return createBiomeBuffer(Vector3i.ZERO, size);
}

/**
* Returns a new biome buffer of the desired size and minimum position.
*
* @param min The minimum point of the buffer.
* @param size The size of the buffer on x, y, and z.
* @return A new biome buffer
*/
MutableBiomeVolume createBiomeBuffer(Vector3i min, Vector3i size);

/**
* Returns a new biome buffer of the desired size.
Expand All @@ -51,14 +62,41 @@ default MutableBiomeVolume createBiomeBuffer(int xSize, int ySize, int zSize) {
return createBiomeBuffer(new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new biome buffer of the desired size and minimum position.
*
* @param xMin The minimum point of the buffer on x
* @param yMin The minimum point of the buffer on y
* @param zMin The minimum point of the buffer on z
* @param xSize The size of the buffer on x
* @param ySize The size of the buffer on y
* @param zSize The size of the buffer on z
* @return A new biome buffer
*/
default MutableBiomeVolume createBiomeBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) {
return createBiomeBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new biome buffer of the desired size. This buffer is thread
* safe.
*
* @param size The size of the buffer on x and z (y in the vector)
* @param size The size of the buffer on x, y, and z.
* @return A new biome buffer
*/
MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i size);
default MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i size) {
return createThreadSafeBiomeBuffer(Vector3i.ZERO, size);
}

/**
* Returns a new biome buffer of the desired size an minimum position. This
* buffer is thread safe.
*
* @param min The minimum point of the buffer.
* @param size The size of the buffer on x, y, and z.
* @return A new biome buffer
*/
MutableBiomeVolume createThreadSafeBiomeBuffer(Vector3i min, Vector3i size);

/**
* Returns a new biome buffer of the desired size. This buffer is thread
Expand All @@ -73,13 +111,40 @@ default MutableBiomeVolume createThreadSafeBiomeBuffer(int xSize, int ySize, int
return createThreadSafeBiomeBuffer(new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new biome buffer of the desired size. This buffer is thread
* safe.
*
* @param xMin The minimum point of the buffer on x
* @param yMin The minimum point of the buffer on y
* @param zMin The minimum point of the buffer on z
* @param xSize The size of the buffer on x
* @param ySize The size of the buffer on y
* @param zSize The size of the buffer on z
* @return A new biome buffer
*/
default MutableBiomeVolume createThreadSafeBiomeBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) {
return createThreadSafeBiomeBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new block buffer of the desired size.
*
* @param size The size of the buffer on x, y and z
* @param size The size of the buffer on x, y, and z
* @return A new block buffer
*/
default MutableBlockVolume createBlockBuffer(Vector3i size) {
return createBlockBuffer(Vector3i.ZERO, size);
}

/**
* Returns a new block buffer of the desired size and minimum position.
*
* @param min The minimum point of the buffer.
* @param size The size of the buffer on x, y, and z
* @return A new block buffer
*/
MutableBlockVolume createBlockBuffer(Vector3i size);
MutableBlockVolume createBlockBuffer(Vector3i min, Vector3i size);

/**
* Returns a new block buffer of the desired size.
Expand All @@ -93,14 +158,41 @@ default MutableBlockVolume createBlockBuffer(int xSize, int ySize, int zSize) {
return createBlockBuffer(new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new block buffer of the desired size and minimum position.
*
* @param xMin The minimum point of the buffer on x
* @param yMin The minimum point of the buffer on y
* @param zMin The minimum point of the buffer on z
* @param xSize The size of the buffer on x
* @param ySize The size of the buffer on y
* @param zSize The size of the buffer on z
* @return A new block buffer
*/
default MutableBlockVolume createBlockBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) {
return createBlockBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new block buffer of the desired size. This buffer is thread
* safe.
*
* @param size The size of the buffer on x, y and z
* @param size The size of the buffer on x, y, and z
* @return A new block buffer
*/
MutableBlockVolume createThreadSafeBlockBuffer(Vector3i size);
default MutableBlockVolume createThreadSafeBlockBuffer(Vector3i size) {
return createThreadSafeBlockBuffer(Vector3i.ZERO, size);
}

/**
* Returns a new block buffer of the desired size and minimum position. This
* buffer is thread safe.
*
* @param min The minimum point of the buffer.
* @param size The size of the buffer on x, y, and z
* @return A new block buffer
*/
MutableBlockVolume createThreadSafeBlockBuffer(Vector3i min, Vector3i size);

/**
* Returns a new block buffer of the desired size. This buffer is thread
Expand All @@ -115,6 +207,22 @@ default MutableBlockVolume createThreadSafeBlockBuffer(int xSize, int ySize, int
return createThreadSafeBlockBuffer(new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new block buffer of the desired size and minimum position. This
* buffer is thread safe.
*
* @param xMin The minimum point of the buffer on x
* @param yMin The minimum point of the buffer on y
* @param zMin The minimum point of the buffer on z
* @param xSize The size of the buffer on x
* @param ySize The size of the buffer on y
* @param zSize The size of the buffer on z
* @return A new block buffer
*/
default MutableBlockVolume createThreadSafeBlockBuffer(int xMin, int yMin, int zMin, int xSize, int ySize, int zSize) {
return createThreadSafeBlockBuffer(new Vector3i(xMin, yMin, zMin), new Vector3i(xSize, ySize, zSize));
}

/**
* Returns a new archetype volume of the desired size.
*
Expand Down

0 comments on commit 6cb5c97

Please sign in to comment.