/// <summary>
 /// Gets player data.
 /// </summary>
 public static PlayerData GetPlayerData(LeagueEntry entry)
 {
     string filename = GetPlayerFilename(entry);
     if (!File.Exists(filename))
     {
         PlayerData data = new PlayerData(entry.PlayerOrTeamId);
         SetPlayerData(entry, data);
         return data;
     }
     else
     {
         string json = File.ReadAllText(filename);
         PlayerData data = JsonConvert.DeserializeObject<PlayerData>(json);
         return data;
     }
 }
 private static string GetPlayerFilename(LeagueEntry entry)
 {
     // We store minimal information here, so no need to compress
     return Path.Combine(PlayerRoot, entry.PlayerOrTeamId + ".json");
 }
 /// <summary>
 /// Stores player data.
 /// </summary>
 /// <param name="entry"></param>
 /// <param name="playerData"></param>
 public static void SetPlayerData(LeagueEntry entry, PlayerData playerData)
 {
     string filename = GetPlayerFilename(entry);
     string json = JsonConvert.SerializeObject(playerData, Formatting.Indented);
     File.WriteAllText(filename, json);
 }