private static Day24Solver.Group ParseGroupWithoutWeaknessImmunities(Match match,
                                                                             Day24Solver.Group.GroupType type)
        {
            var units      = int.Parse(match.Groups[1].Value);
            var hitPoints  = int.Parse(match.Groups[2].Value);
            var damage     = int.Parse(match.Groups[3].Value);
            var damageType = match.Groups[4].Value;
            var initiative = int.Parse(match.Groups[5].Value);

            return(new Day24Solver.Group(type, units, hitPoints, damage, damageType, initiative));
        }
        private Day24Solver.Group ParseGroup(string line, Day24Solver.Group.GroupType groupType)
        {
            var match = groupWithWeaknessImmunityParsingRegex.Match(line);

            if (match.Success)
            {
                return(ParseGroupWithWeaknessImmunities(match, groupType));
            }

            match = groupWithoutWeaknessImmunityParsinRegex.Match(line);
            return(ParseGroupWithoutWeaknessImmunities(match, groupType));
        }
        private static Day24Solver.Group ParseGroupWithWeaknessImmunities(Match match, Day24Solver.Group.GroupType type)
        {
            var units     = int.Parse(match.Groups[1].Value);
            var hitPoints = int.Parse(match.Groups[2].Value);
            var weaknessesAndImmunities = match.Groups[3].Value;
            var damage     = int.Parse(match.Groups[4].Value);
            var damageType = match.Groups[5].Value;
            var initiative = int.Parse(match.Groups[6].Value);
            var group      = new Day24Solver.Group(type, units, hitPoints, damage, damageType, initiative);

            ParseWeaknessesAndImmunities(group, weaknessesAndImmunities);
            return(group);
        }