ElectroChecker.Vuln2Methods.GenVotes C# (CSharp) Method

GenVotes() private static method

private static GenVotes ( string flag, Election election ) : int[][]
flag string
election Electro.Model.Election
return int[][]
        private static int[][] GenVotes(string flag, Election election)
        {
            var candidateInfos = election.Candidates.ToArray();
            var votes = flag.Select(c =>
            {
                var votePos = candidateInfos.IndexOf(info => info.PublicMessage == c.ToString());
                if(votePos < 0)
                    throw new ServiceException(ExitCode.MUMBLE, "Nominated candidates for all flag characters but in resulting election have not for all");
                return Utils.GenVoteVector(candidateInfos.Length, votePos);
            }).ToArray();
            return votes;
        }