mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-09-11 19:55:21 +00:00
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
namespace Fuse
|
|
{
|
|
using System.Collections.Generic;
|
|
|
|
public class Result
|
|
{
|
|
private readonly TestEvents events = new TestEvents();
|
|
|
|
public bool Valid => !string.IsNullOrEmpty(this.Description);
|
|
|
|
public string Description { get; private set; }
|
|
|
|
public RegisterState RegisterState { get; } = new RegisterState();
|
|
|
|
public List<MemoryDatum> MemoryData { get; } = new List<MemoryDatum>();
|
|
|
|
public void Parse(Lines lines)
|
|
{
|
|
while (!lines.EndOfFile && !this.Valid)
|
|
{
|
|
this.Description = lines.ReadLine();
|
|
}
|
|
|
|
if (!this.Valid)
|
|
{
|
|
return;
|
|
}
|
|
|
|
this.events.Parse(lines);
|
|
this.RegisterState.Parse(lines);
|
|
|
|
var finished = false;
|
|
do
|
|
{
|
|
var line = lines.ReadLine();
|
|
finished = string.IsNullOrWhiteSpace(line);
|
|
if (!finished)
|
|
{
|
|
var datum = new MemoryDatum();
|
|
datum.Parse(line);
|
|
this.MemoryData.Add(datum);
|
|
}
|
|
}
|
|
while (!finished);
|
|
}
|
|
}
|
|
}
|