using System.Collections.Generic;
using System.Diagnostics;
public static void Main(string[] args)
private static void testCases()
private static void verify(object expect, object actual)
var expectedList = (List<int>)expect;
var actualList = (List<int>)actual;
if (expectedList.Count != actualList.Count) { Console.WriteLine("Error: Mismatch list count"); return; }
for(var i=0; i<expectedList.Count; i++)
if (e != a) { Console.WriteLine("Error: Mismatch, Expected={0}, Actual={1}",e,a); return; }
private static object model(object t)
var output = new List<object>();
private static object solve(object t)
var output = new List<object>();
var o = capture(i.End.Flags);
private static void ensure(StateDef begin)
throw new NotImplementedException();
private static object capture(List<Flag> flags)
throw new NotImplementedException();
private static object execute(StateAction action)
throw new NotImplementedException();
private static IEnumerable<object> read()
var model = ModelReader.Read(FileType.Json, file);
foreach (var p in model.Paths)
private static List<int> generate(int count = 10)
var list = new List<int>();
for (int i = 0; i < count; i++)
list.Add(r.Next(int.MaxValue));
public static Model Read(FileType type, string file)
throw new NotImplementedException();
public List<Flag> Flags { get; set; }
public List<StateDef> States { get; set; }
public List<StateAction> Actions { get; set; }
public List<StatePath> Paths { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public object Value { get; set; }
public override bool Equals(object obj)
if (other == null) return false;
return this.Id == other.Id && this.Name == other.Name && this.Value == other.Value;
public override int GetHashCode()
return base.GetHashCode();
public int Id { get; set; }
public string Name { get; set; }
public List<Flag> Flags { get; set; }
public override bool Equals(object obj)
var other = (StateDef)obj;
if (other == null) return false;
if (other.Flags == null || other.Flags.Count == 0) return false;
if (Flags.Count != other.Flags.Count) return false;
var map2 = new Dictionary<int, Flag>();
foreach(var f in other.Flags)
if (!map2.ContainsKey(f.Id)) { return false; }
if (f != f2) return false;
public override int GetHashCode()
return base.GetHashCode();
public string Name { get; set; }
public class StatePath : List<StateTransition>
public class StateTransition
public StateDef Begin { get; set; }
public StateDef End { get; set; }
public StateAction Action { get; set; }