mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-01-23 08:16:25 +00:00
42 lines
950 B
C#
42 lines
950 B
C#
namespace Z80.HarteTest
|
|
{
|
|
internal sealed class Test
|
|
{
|
|
public string? Name { get; set; }
|
|
|
|
public State? Initial { get; set; }
|
|
|
|
public State? Final { get; set; }
|
|
|
|
public List<List<object>>? Cycles { get; set; }
|
|
|
|
public List<List<object>>? Ports { get; set; }
|
|
|
|
public IEnumerable<Cycle> AvailableCycles()
|
|
{
|
|
if (this.Cycles is null)
|
|
{
|
|
throw new InvalidOperationException("Cycles have not been initialised");
|
|
}
|
|
|
|
foreach (var cycle in this.Cycles)
|
|
{
|
|
yield return new Cycle(cycle);
|
|
}
|
|
}
|
|
|
|
public IEnumerable<Port> AvailablePorts()
|
|
{
|
|
if (this.Ports is null)
|
|
{
|
|
yield break;
|
|
}
|
|
|
|
foreach (var port in this.Ports)
|
|
{
|
|
yield return new Port(port);
|
|
}
|
|
}
|
|
}
|
|
}
|