Exemplo n.º 1
0
 internal void SaveToHighScoreList(HighScore s)
 {
     try
     {
         var hsl = GetHighScoreList() ?? new List <HighScore>();
         hsl.Add(s);
         var save = MessagePackSerializer.Serialize(hsl);
         File.WriteAllBytes($@"{AGCTools.GetGameFolder()}\highScores", save);
     }
     catch (Exception e)
     {
         AGCTools.LogException(e);
     }
 }
Exemplo n.º 2
0
 internal List <HighScore> GetHighScoreList()
 {
     try
     {
         var highScores = $@"{AGCTools.GetGameFolder()}\highScores";
         if (!File.Exists(highScores))
         {
             return(null);
         }
         var hsd = File.ReadAllBytes(highScores);
         return(MessagePackSerializer.Deserialize <List <HighScore> >(hsd));
     }
     catch (Exception e)
     {
         AGCTools.LogException(e);
         return(null);
     }
 }