package fr.bglands.client.protocol;

import java.util.Objects;

/** Presentation data only. Buttons reference a bounded cN control, never a command. */
public record UiSceneWidget(
        String id,
        String kind,
        int x,
        int y,
        int width,
        int height,
        int z,
        String asset,
        String label,
        String binding,
        String color,
        int fontSize,
        String align,
        String controlId
) {
    public UiSceneWidget {
        Objects.requireNonNull(id, "id");
        Objects.requireNonNull(kind, "kind");
        asset = asset == null ? "" : asset;
        label = label == null ? "" : label;
        binding = binding == null ? "" : binding;
        color = color == null ? "" : color;
        align = align == null ? "left" : align;
        controlId = controlId == null ? "" : controlId;
    }
}
