private static PlayerAgePoll ConvertPlayerAgePoll(_Poll[] polls) { _Poll poll = polls.FirstOrDefault(p => p.Name == "suggested_playerage"); if (poll == null) { return(null); } _PollResults result = poll.Results.FirstOrDefault(); if (result == null) { return(null); } return(new PlayerAgePoll { TotalVotes = poll.TotalVotes, Age2Votes = result.Results.FirstOrDefault(rr => rr.Value == "2")?.NumberOfVotes ?? 0, Age3Votes = result.Results.FirstOrDefault(rr => rr.Value == "3")?.NumberOfVotes ?? 0, Age4Votes = result.Results.FirstOrDefault(rr => rr.Value == "4")?.NumberOfVotes ?? 0, Age5Votes = result.Results.FirstOrDefault(rr => rr.Value == "5")?.NumberOfVotes ?? 0, Age6Votes = result.Results.FirstOrDefault(rr => rr.Value == "6")?.NumberOfVotes ?? 0, Age8Votes = result.Results.FirstOrDefault(rr => rr.Value == "8")?.NumberOfVotes ?? 0, Age10Votes = result.Results.FirstOrDefault(rr => rr.Value == "10")?.NumberOfVotes ?? 0, Age12Votes = result.Results.FirstOrDefault(rr => rr.Value == "12")?.NumberOfVotes ?? 0, Age14Votes = result.Results.FirstOrDefault(rr => rr.Value == "14")?.NumberOfVotes ?? 0, Age16Votes = result.Results.FirstOrDefault(rr => rr.Value == "16")?.NumberOfVotes ?? 0, Age18Votes = result.Results.FirstOrDefault(rr => rr.Value == "18")?.NumberOfVotes ?? 0, Age21AndUpVotes = result.Results.FirstOrDefault(rr => rr.Value == "21 and up")?.NumberOfVotes ?? 0 }); }
private static LanguageDependencePoll ConvertLanguageDependence(_Poll[] polls) { _Poll poll = polls.FirstOrDefault(p => p.Name == "language_dependence"); if (poll == null) { return(null); } _PollResults result = poll.Results.FirstOrDefault(); if (result == null) { return(null); } return(new LanguageDependencePoll { TotalVotes = poll.TotalVotes, NoNecessaryInGameTextVotes = result.Results.FirstOrDefault(rr => rr.Level == 1)?.NumberOfVotes ?? 0, SomeNecessaryInGameTextVotes = result.Results.FirstOrDefault(rr => rr.Level == 2)?.NumberOfVotes ?? 0, ModerateInGameTextVotes = result.Results.FirstOrDefault(rr => rr.Level == 3)?.NumberOfVotes ?? 0, ExtensiveInGameTextVotes = result.Results.FirstOrDefault(rr => rr.Level == 4)?.NumberOfVotes ?? 0, UnplayableInAnotherLanguageVotes = result.Results.FirstOrDefault(rr => rr.Level == 5)?.NumberOfVotes ?? 0 }); }