// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.procedurallib.supplier;

import java.util.Objects;
import javax.annotation.Nonnull;
import com.hypixel.hytale.procedurallib.property.NoiseProperty;

public class FloatRangeNoiseSupplier implements IFloatCoordinateSupplier
{
    protected final IFloatRange range;
    @Nonnull
    protected final NoiseProperty noiseProperty;
    @Nonnull
    protected final IDoubleCoordinateSupplier2d supplier2d;
    @Nonnull
    protected final IDoubleCoordinateSupplier3d supplier3d;
    
    public FloatRangeNoiseSupplier(final IFloatRange range, @Nonnull final NoiseProperty noiseProperty) {
        this.range = range;
        Objects.requireNonNull(this.noiseProperty = noiseProperty);
        this.supplier2d = noiseProperty::get;
        Objects.requireNonNull(noiseProperty);
        this.supplier3d = noiseProperty::get;
    }
    
    @Override
    public float get(final int seed, final double x, final double y) {
        return this.range.getValue(seed, x, y, this.supplier2d);
    }
    
    @Override
    public float get(final int seed, final double x, final double y, final double z) {
        return this.range.getValue(seed, x, y, z, this.supplier3d);
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "FloatRangeNoiseSupplier{range=" + String.valueOf(this.range) + ", noiseProperty=" + String.valueOf(this.noiseProperty);
    }
}
