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

package com.hypixel.hytale.builtin.hytalegenerator.materialproviders.spaceanddepth.conditions;

import javax.annotation.Nonnull;
import com.hypixel.hytale.builtin.hytalegenerator.materialproviders.spaceanddepth.SpaceAndDepthMaterialProvider;

public class GreaterThanCondition implements SpaceAndDepthMaterialProvider.Condition
{
    private final int threshold;
    @Nonnull
    private final ConditionParameter parameter;
    
    public GreaterThanCondition(final int threshold, @Nonnull final ConditionParameter parameter) {
        this.threshold = threshold;
        this.parameter = parameter;
    }
    
    @Override
    public boolean qualifies(final int x, final int y, final int z, final int depthIntoFloor, final int depthIntoCeiling, final int spaceAboveFloor, final int spaceBelowCeiling) {
        final int contextValue = switch (this.parameter) {
            default -> throw new MatchException(null, null);
            case SPACE_ABOVE_FLOOR -> spaceAboveFloor;
            case SPACE_BELOW_CEILING -> spaceBelowCeiling;
        };
        return contextValue > this.threshold;
    }
}
