Class AbstractBuiltinDataset

java.lang.Object
net.buildtheearth.terracore.worldgen.dataset.builtin.AbstractBuiltinDataset
All Implemented Interfaces:
IScalarDataset
Direct Known Subclasses:
Climate, Soil

public abstract class AbstractBuiltinDataset extends Object implements IScalarDataset
Abstract implementation of IScalarDataset for the builtin datasets.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final double
     
    protected final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractBuiltinDataset(int samplesX, int samplesY)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract double
    get(double x, double y)
     
    getAsync(double lon, double lat)
    Asynchronously gets a single value at the given point.
    getAsync(@NonNull net.buildtheearth.terracore.geo.CornerBoundingBox2d bounds, int sizeX, int sizeZ)
    Asynchronously gets a bunch of values at the given coordinates.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.buildtheearth.terracore.worldgen.dataset.IScalarDataset

    getAsync
  • Field Details

    • scaleX

      protected final double scaleX
    • scaleY

      protected final double scaleY
  • Constructor Details

    • AbstractBuiltinDataset

      public AbstractBuiltinDataset(int samplesX, int samplesY)
  • Method Details

    • getAsync

      public CompletableFuture<Double> getAsync(double lon, double lat) throws net.buildtheearth.terracore.geo.projection.OutOfProjectionBoundsException
      Description copied from interface: IScalarDataset
      Asynchronously gets a single value at the given point.
      Specified by:
      getAsync in interface IScalarDataset
      Parameters:
      lon - the longitude
      lat - the latitude
      Returns:
      a CompletableFuture which will be completed with the value
      Throws:
      net.buildtheearth.terracore.geo.projection.OutOfProjectionBoundsException
    • getAsync

      public CompletableFuture<double[]> getAsync(@NonNull @NonNull net.buildtheearth.terracore.geo.CornerBoundingBox2d bounds, int sizeX, int sizeZ) throws net.buildtheearth.terracore.geo.projection.OutOfProjectionBoundsException
      Description copied from interface: IScalarDataset
      Asynchronously gets a bunch of values at the given coordinates.
      Specified by:
      getAsync in interface IScalarDataset
      Parameters:
      sizeX - the number of samples to take along the X axis
      sizeZ - the number of samples to take along the Z axis
      Returns:
      a CompletableFuture which will be completed with the values
      Throws:
      net.buildtheearth.terracore.geo.projection.OutOfProjectionBoundsException
    • get

      protected abstract double get(double x, double y)