public Player(JToken playerDataJToken) { Steamid = playerDataJToken.Value <long?>("steamid"); Clan = playerDataJToken.Value <string>("clan"); Name = playerDataJToken.Value <string>("name"); Team = playerDataJToken.Value <string>("team"); Activity = playerDataJToken.Value <string>("activity"); if (playerDataJToken["state"] != null) { State = new State(playerDataJToken["state"]); } if (playerDataJToken["weapons"] != null) { Weapons = new Weapons(playerDataJToken["weapons"]); } if (playerDataJToken["match_stats"] != null) { MatchStats = new MatchStats(playerDataJToken["match_stats"]); } }
public AllPlayer(JToken allPlayerDataJToken) { //SteamId is the name of the parent Node long tempSteamid; if (long.TryParse(((JProperty)allPlayerDataJToken.Parent).Name, out tempSteamid)) { Steamid = tempSteamid; } Clan = allPlayerDataJToken.Value <string>("clan"); Name = allPlayerDataJToken.Value <string>("name"); Team = allPlayerDataJToken.Value <string>("team"); if (allPlayerDataJToken["state"] != null) { State = new State(allPlayerDataJToken["state"]); } if (allPlayerDataJToken["match_stats"] != null) { MatchStats = new MatchStats(allPlayerDataJToken["match_stats"]); } }