package p.studio.workspaces.assets.tiled;

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

public record TiledObjectData(
        int id,
        String name,
        double x,
        double y,
        double width,
        double height,
        List<TiledPoint> polygonPoints,
        List<TiledProperty> properties) {

    public TiledObjectData {
        name = Objects.requireNonNullElse(name, "").trim();
        polygonPoints = List.copyOf(Objects.requireNonNull(polygonPoints, "polygonPoints"));
        properties = List.copyOf(Objects.requireNonNull(properties, "properties"));
    }
}
