package thb.jeanluc.adventure.loader.dto;

import java.util.List;

/**
 * YAML representation of a single item. Fields outside of the type's
 * scope (e.g. {@code readText} on a switchable) are simply ignored.
 *
 * @param type         discriminator: {@code plain | readable | switchable}
 * @param id           unique slug
 * @param name         display name
 * @param description  examine description
 * @param readText     text printed when a readable item is used
 * @param initialState initial on/off state of a switchable item
 * @param onText       message printed when a switchable transitions to on
 * @param offText      message printed when a switchable transitions to off
 * @param effects      effects applied when a switchable transitions to on; nullable
 * @param light        whether this item is a light source; nullable
 */
public record ItemDto(
        String type,
        String id,
        String name,
        String description,
        String readText,
        Boolean initialState,
        String onText,
        String offText,
        List<EffectDto> effects,
        Boolean light
) {
    /** Backward-compatible constructor without effects/light. */
    public ItemDto(String type, String id, String name, String description,
                   String readText, Boolean initialState, String onText, String offText) {
        this(type, id, name, description, readText, initialState, onText, offText, null, null);
    }
}
