public static Technique[] Parse(IEnumerable <string> lines, long numCards) { var parsedInputs = new List <Technique>(); foreach (var line in lines) { var split = line.Split(' '); Technique pi = null; if (split[0] == "cut") { pi = new Cut(split[1], numCards); } else if (split[0] == "deal") { if (split[3] == "stack") { pi = new Revert(); } else { pi = new Deal(split[3], numCards); } } else { throw new Exception("unparseable line"); } parsedInputs.Add(pi); } return(parsedInputs.ToArray()); }
public void Setup(long numCards) { this.numCards = numCards; techniques = Technique.Parse(lines, numCards); _CombinedTechniques = (1, 0); }