package fr.bglands.client.protocol;

import java.util.List;
import java.util.Objects;

public record OpenScreen(
        int protocolMajor,
        String instanceId,
        int revision,
        String route,
        String title,
        String content,
        String accent,
        int columns,
        String background,
        boolean showExitAction,
        List<UiControl> controls,
        UiScene scene
) implements ServerMessage {
    public OpenScreen {
        Objects.requireNonNull(instanceId, "instanceId");
        Objects.requireNonNull(route, "route");
        title = title == null ? "" : title;
        content = content == null ? "" : content;
        accent = accent == null ? "green" : accent;
        background = background == null ? "" : background;
        controls = List.copyOf(controls);
    }
}
