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

package com.hypixel.hytale.procedurallib.condition;

import javax.annotation.Nonnull;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.logic.GeneralNoise;

public class HeightThresholdCoordinateCondition implements ICoordinateCondition
{
    private final IHeightThresholdInterpreter interpreter;
    
    public HeightThresholdCoordinateCondition(final IHeightThresholdInterpreter interpreter) {
        this.interpreter = interpreter;
    }
    
    @Override
    public boolean eval(final int seed, final int x, final int y) {
        throw new UnsupportedOperationException("This needs a height to operate.");
    }
    
    @Override
    public boolean eval(final int seed, final int x, final int y, final int z) {
        return this.interpreter.getThreshold(seed, x, z, y) >= HashUtil.random(seed, GeneralNoise.fastFloor(x), GeneralNoise.fastFloor(y), GeneralNoise.fastFloor(z));
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "HeightThresholdCoordinateCondition{interpreter=" + String.valueOf(this.interpreter);
    }
}
