2024-11-19 09:05:00 -07:00

45 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.pcl;
#nullable enable
internal class Complete
{
public Complete(Header header, Wafer[] wafers)
{
Header = header;
Wafers = wafers;
}
public Header Header { get; }
public Wafer[] Wafers { get; }
internal static Complete? Get(string headerFileName, Dictionary<string, string> pages, Constant constant)
{
Complete? result;
Header? header = Header.Get(headerFileName, pages, constant);
if (header is null)
result = null;
else
{
ReadOnlyCollection<Wafer> wafers = Wafer.Get(headerFileName, pages, constant);
if (wafers.Count == 0)
result = null;
else
result = new(header, wafers.ToArray());
}
return result;
}
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Complete))]
internal partial class CompleteSourceGenerationContext : JsonSerializerContext
{
}