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

package com.hypixel.hytale.procedurallib.logic.point;

import javax.annotation.Nonnull;
import com.hypixel.hytale.procedurallib.logic.ResultBuffer;

public class OffsetPointGenerator implements IPointGenerator
{
    private final IPointGenerator generator;
    private final double offsetX;
    private final double offsetY;
    private final double offsetZ;
    
    public OffsetPointGenerator(final IPointGenerator generator, final double offsetX, final double offsetY, final double offsetZ) {
        this.generator = generator;
        this.offsetX = offsetX;
        this.offsetY = offsetY;
        this.offsetZ = offsetZ;
    }
    
    public double getOffsetX() {
        return this.offsetX;
    }
    
    public double getOffsetY() {
        return this.offsetY;
    }
    
    public double getOffsetZ() {
        return this.offsetZ;
    }
    
    @Override
    public ResultBuffer.ResultBuffer2d nearest2D(final int seed, final double x, final double y) {
        return this.generator.nearest2D(seed, x + this.offsetX, y + this.offsetY);
    }
    
    @Override
    public ResultBuffer.ResultBuffer3d nearest3D(final int seed, final double x, final double y, final double z) {
        return this.generator.nearest3D(seed, x + this.offsetX, y + this.offsetY, z + this.offsetZ);
    }
    
    @Override
    public ResultBuffer.ResultBuffer2d transition2D(final int seed, final double x, final double y) {
        return this.generator.transition2D(seed, x + this.offsetX, y + this.offsetY);
    }
    
    @Override
    public ResultBuffer.ResultBuffer3d transition3D(final int seed, final double x, final double y, final double z) {
        return this.generator.transition3D(seed, x + this.offsetX, y + this.offsetY, z + this.offsetZ);
    }
    
    @Override
    public void collect(final int seed, final double minX, final double minY, final double maxX, final double maxY, @Nonnull final PointConsumer2d consumer) {
        this.generator.collect(seed, minX, minY, maxX, maxY, (x, y) -> consumer.accept(x + this.offsetX, y + this.offsetY));
    }
    
    @Override
    public double getInterval() {
        return this.generator.getInterval();
    }
}
