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

package com.hypixel.hytale.server.worldgen.util.condition;

import javax.annotation.Nonnull;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.procedurallib.condition.ICoordinateCondition;

public class RandomCoordinateCondition implements ICoordinateCondition
{
    private final double chance;
    
    public RandomCoordinateCondition(final double chance) {
        this.chance = chance;
    }
    
    @Override
    public boolean eval(final int seed, final int x, final int y) {
        return HashUtil.random(seed, x, y) <= this.chance;
    }
    
    @Override
    public boolean eval(final int seed, final int x, final int y, final int z) {
        return HashUtil.random(seed, x, y, z) <= this.chance;
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "RandomCoordinateCondition{chance=" + this.chance;
    }
}
