Этап 2

This commit is contained in:
2026-03-29 15:34:33 +03:00
parent 09d52aa973
commit 08b9039b58
19 changed files with 872 additions and 3 deletions

View File

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