namespace Minint.Core.Models;
///
/// Top-level container: holds dimensions shared by all documents/layers,
/// and a list of documents (frames).
///
public sealed class MinintContainer
{
public int Width { get; set; }
public int Height { get; set; }
public List Documents { get; }
public int PixelCount => Width * Height;
public MinintContainer(int width, int height)
{
ArgumentOutOfRangeException.ThrowIfLessThan(width, 1);
ArgumentOutOfRangeException.ThrowIfLessThan(height, 1);
Width = width;
Height = height;
Documents = [];
}
///
/// Creates a new document with a single transparent layer and adds it to the container.
///
public MinintDocument AddNewDocument(string name)
{
var doc = new MinintDocument(name);
doc.Layers.Add(new MinintLayer("Layer 1", PixelCount));
Documents.Add(doc);
return doc;
}
}