public IHighscoreTable Load()
{
try
{
XDocument highscoreDoc = XDocument.Load(this.FileName);
var playerScores = highscoreDoc.Descendants("player")
.Select(x => new PlayerScore(
x.Element("name").Value,
int.Parse(x.Element("moves").Value),
DateTime.Parse(x.Element("time").Value)))
.ToList();
return new HighscoreTable(playerScores);
}
catch (Exception)
{
Logger.Warn("No highscore.xml, falling back to empty highscore table.");
return new HighscoreTable();
}
}