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

package com.hypixel.hytale.procedurallib.random;

import javax.annotation.Nonnull;

public class RotatedCoordinateRandomizer implements ICoordinateRandomizer
{
    protected final ICoordinateRandomizer randomizer;
    protected final CoordinateRotator rotation;
    
    public RotatedCoordinateRandomizer(final ICoordinateRandomizer randomizer, final CoordinateRotator rotation) {
        this.randomizer = randomizer;
        this.rotation = rotation;
    }
    
    @Override
    public double randomDoubleX(final int seed, final double x, final double y) {
        final double px = this.rotation.rotateX(x, y);
        final double py = this.rotation.rotateY(x, y);
        return this.randomizer.randomDoubleX(seed, px, py);
    }
    
    @Override
    public double randomDoubleY(final int seed, final double x, final double y) {
        final double px = this.rotation.rotateX(x, y);
        final double py = this.rotation.rotateY(x, y);
        return this.randomizer.randomDoubleY(seed, px, py);
    }
    
    @Override
    public double randomDoubleX(final int seed, final double x, final double y, final double z) {
        final double px = this.rotation.rotateX(x, y, z);
        final double py = this.rotation.rotateY(x, y, z);
        final double pz = this.rotation.rotateZ(x, y, z);
        return this.randomizer.randomDoubleX(seed, px, py, pz);
    }
    
    @Override
    public double randomDoubleY(final int seed, final double x, final double y, final double z) {
        final double px = this.rotation.rotateX(x, y, z);
        final double py = this.rotation.rotateY(x, y, z);
        final double pz = this.rotation.rotateZ(x, y, z);
        return this.randomizer.randomDoubleY(seed, px, py, pz);
    }
    
    @Override
    public double randomDoubleZ(final int seed, final double x, final double y, final double z) {
        final double px = this.rotation.rotateX(x, y, z);
        final double py = this.rotation.rotateY(x, y, z);
        final double pz = this.rotation.rotateZ(x, y, z);
        return this.randomizer.randomDoubleZ(seed, px, py, pz);
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "RotatedCoordinateRandomizer{randomizer=" + String.valueOf(this.randomizer) + ", rotation=" + String.valueOf(this.rotation);
    }
}
