package net.minecraft.world.level.storage.loot.entries;

import java.util.Objects;
import java.util.function.Consumer;
import net.minecraft.world.level.storage.loot.LootContext;

@FunctionalInterface
interface ComposableEntryContainer {
    public static final ComposableEntryContainer ALWAYS_FALSE = (dat, consumer) -> false;
    public static final ComposableEntryContainer ALWAYS_TRUE = (dat, consumer) -> true;
    
    boolean expand(final LootContext dat, final Consumer<LootPoolEntry> consumer);
    
    default ComposableEntryContainer and(final ComposableEntryContainer dbg) {
        Objects.<ComposableEntryContainer>requireNonNull(dbg);
        return (dat, consumer) -> this.expand(dat, consumer) && dbg.expand(dat, consumer);
    }
    
    default ComposableEntryContainer or(final ComposableEntryContainer dbg) {
        Objects.<ComposableEntryContainer>requireNonNull(dbg);
        return (dat, consumer) -> this.expand(dat, consumer) || dbg.expand(dat, consumer);
    }
}
