Files
EightBitNet/Fuse/Results.cs
2024-10-12 09:28:05 +01:00

32 lines
870 B
C#

// <copyright file="Results.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace Fuse
{
using System.Collections.Generic;
using System.Diagnostics;
public class Results<T>(string path)
where T : Fuse.IRegisterState, new()
{
private readonly Lines lines = new(path);
public Dictionary<string, Result<T>> Container { get; } = [];
public void Read() => this.lines.Read();
public void Parse()
{
while (!this.lines.EndOfFile)
{
var result = new Result<T>();
if (result.TryParse(this.lines))
{
Debug.Assert(result.Description is not null);
this.Container.Add(result.Description, result);
}
}
}
}
}