internal Match(IDictionary <string, object> dict) { foreach (string key in dict.Keys) { object value; dict.TryGetValue(key, out value); if (value == null) { continue; } string valueString = value.ToString(); switch (key) { case "match_id": MatchId = valueString; break; case "filters": List <string> filterList = new List <string> (); JsonArray filterArray = (JsonArray)value; foreach (string entryObject in filterArray) { filterList.Add(entryObject); } Filters = filterList.ToArray(); break; case "created_at": CreatedAt = (long)value; break; case "updated_at": UpdatedAt = (long)value; break; case "gamers": List <string> gamerList = new List <string> (); JsonArray gamerArray = (JsonArray)value; foreach (string entryObject in gamerArray) { gamerList.Add(entryObject); } Gamers = gamerList.ToArray(); break; case "active_gamers": ActiveGamers = new ActiveGamers((JsonArray)value); break; case "active": Active = (Boolean)value; break; case "turn": Turn = valueString; break; case "turn_gamer_id": TurnGamerId = valueString; break; case "turn_count": TurnCount = (long)value; break; case "whoami": Whoami = valueString; break; case "whoami_gamer_id": WhoamiGamerId = valueString; break; } } }
internal Match(IDictionary<string, object> dict) { foreach (string key in dict.Keys) { object value; dict.TryGetValue (key, out value); if (value == null) { continue; } string valueString = value.ToString (); switch (key) { case "match_id": MatchId = valueString; break; case "filters": List<string> filterList = new List<string> (); JsonArray filterArray = (JsonArray)value; foreach (string entryObject in filterArray) { filterList.Add (entryObject); } Filters = filterList.ToArray (); break; case "created_at": CreatedAt = (long)value; break; case "updated_at": UpdatedAt = (long)value; break; case "gamers": List<string> gamerList = new List<string> (); JsonArray gamerArray = (JsonArray)value; foreach (string entryObject in gamerArray) { gamerList.Add (entryObject); } Gamers = gamerList.ToArray (); break; case "active_gamers": ActiveGamers = new ActiveGamers((JsonArray) value); break; case "active": Active = (Boolean)value; break; case "turn": Turn = valueString; break; case "turn_gamer_id": TurnGamerId = valueString; break; case "turn_count": TurnCount = (long)value; break; case "whoami": Whoami = valueString; break; case "whoami_gamer_id": WhoamiGamerId = valueString; break; } } }