Ejemplo n.º 1
0
        public Tickets(string[] rules, string myTicket, string[] otherTickets)
        {
            Rules = new Dictionary <string, Validator>();
            foreach (var rule in rules)
            {
                var groups = ParseRule.Match(rule).Groups;
                Rules.Add(groups[1].Value, new Validator(int.Parse(groups[2].Value), int.Parse(groups[3].Value), int.Parse(groups[4].Value), int.Parse(groups[5].Value)));
            }

            MyTicket     = ParseTicket(myTicket);
            OtherTickets = otherTickets.Select(ParseTicket).ToArray();
        }