package p.studio.workspaces.assets.tiled;

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

public record TiledTilesetTile(
        int id,
        String imageSource,
        int imageWidth,
        int imageHeight,
        List<TiledProperty> properties,
        TiledObjectLayer collisionLayer) {

    public TiledTilesetTile {
        imageSource = Objects.requireNonNull(imageSource, "imageSource").trim();
        properties = List.copyOf(Objects.requireNonNull(properties, "properties"));
        if (imageSource.isBlank()) {
            throw new IllegalArgumentException("imageSource must not be blank");
        }
    }
}
