package net.minecraft.gametest.framework;

import java.util.Map;
import java.util.function.Consumer;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;

public record GeneratedTest(
    Map<ResourceLocation, TestData<ResourceKey<TestEnvironmentDefinition>>> tests,
    ResourceKey<Consumer<GameTestHelper>> functionKey,
    Consumer<GameTestHelper> function
) {
    public GeneratedTest(
        Map<ResourceLocation, TestData<ResourceKey<TestEnvironmentDefinition>>> tests, ResourceLocation functionKey, Consumer<GameTestHelper> function
    ) {
        this(tests, ResourceKey.create(Registries.TEST_FUNCTION, functionKey), function);
    }

    public GeneratedTest(ResourceLocation functionKey, TestData<ResourceKey<TestEnvironmentDefinition>> testData, Consumer<GameTestHelper> function) {
        this(Map.of(functionKey, testData), functionKey, function);
    }
}
