public GwMatchup FindMatchup(GwWorld world) { if (matchups == null) { matchups = Fetchmatchups(); } return(matchups.Values.First(m => m.Red == world || m.Blue == world || m.Green == world)); }
internal GwMatchupup(Api api, string id, GwWorld red, GwWorld blue, GwWorld green) { this.api = api; Id = id; Red = red; Blue = blue; Green = green; }
private Dictionary <string, Gwmatchup> Fetchmatchups() { var request = new RestRequest(RequestUrls["matchups"], Method.GET); var response = client.Execute <matchupsResult>(request); var result = new Dictionary <string, Gwmatchup>(); foreach (var i in response.Data.wvw_matchups) { var red = new GwWorld(this, i.red_world_id, nameCache.GetWorld(i.red_world_id)); var blue = new GwWorld(this, i.blue_world_id, nameCache.GetWorld(i.blue_world_id)); var green = new GwWorld(this, i.green_world_id, nameCache.GetWorld(i.green_world_id)); var matchup = new Gwmatchup(this, i.wvw_matchup_id, red, blue, green); result.Add(matchup.Id, matchup); } return(result); }