package p.packer.messages;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public record ApplyPaletteOverhaulingRequest(
        PackerProjectContext project,
        AssetReference assetReference,
        List<Map<String, Object>> selectedPalettes) {

    public ApplyPaletteOverhaulingRequest {
        Objects.requireNonNull(project, "project");
        Objects.requireNonNull(assetReference, "assetReference");
        selectedPalettes = List.copyOf(Objects.requireNonNull(selectedPalettes, "selectedPalettes").stream()
                .map(palette -> Map.copyOf(new LinkedHashMap<>(Objects.requireNonNull(palette, "palette"))))
                .toList());
    }
}
