Created
July 9, 2015 11:32
-
-
Save CryZe/9cae41bdde31a6e484ff to your computer and use it in GitHub Desktop.
Barney
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using SpeedrunComSharp; | |
| namespace UnverifiedBarneyRuns | |
| { | |
| public static class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var client = new SpeedrunComClient(); | |
| var barney = client.Games.SearchGame("Barney"); | |
| var anyPercent = barney.Categories.First(x => x.Name == "any%"); | |
| var allRuns = client.Runs.GetRuns(gameId: barney.ID, orderBy: RunsOrdering.Status); | |
| var verifiedRuns = anyPercent.Leaderboard.Count(); | |
| var unverifiedRuns = allRuns.TakeWhile(x => x.Status.Type == RunStatusType.New).Count(); | |
| var totalRuns = unverifiedRuns + verifiedRuns; | |
| Console.WriteLine("Barney has {0} runs ({1} of which are unverified)", totalRuns, unverifiedRuns); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment