コード例 #1
0
        /// <summary>
        /// Gets the User from <paramref name="score"/>
        /// </summary>
        public static HistoryUser GetUser(HistoryScore score, History history)
        {
            if (score == null)
            {
                throw new ArgumentNullException(nameof(score));
            }

            return(GetUser(score.UserId, history));
        }
コード例 #2
0
    public void AddHistoryScore(HistoryScore hs)
    {
        if (hs == null)
        {
            DebugUtil.Warning("hs is NULL !!!");
            return;
        }

        _historyScores.Add(hs);
        try
        {
            using (StreamWriter sw = new StreamWriter(HistoryScoresFilePath, true))
            {
                string line = JsonUtility.ToJson(hs);
                sw.WriteLine(line);
            }
        }
        catch (Exception e)
        {
            DebugUtil.Error(e.Message);
        }
    }
コード例 #3
0
 void _InitHistoryScores()
 {
     _historyScores = new List <HistoryScore>();
     try
     {
         using (FileStream fs = new FileStream(HistoryScoresFilePath, FileMode.OpenOrCreate))
         {
             using (StreamReader sr = new StreamReader(fs))
             {
                 string line;
                 while ((line = sr.ReadLine()) != null)
                 {
                     HistoryScore hs = JsonUtility.FromJson <HistoryScore>(line);
                     _historyScores.Add(hs);
                 }
             }
         }
     }
     catch (Exception e)
     {
         DebugUtil.Error(e.Message);
     }
 }
コード例 #4
0
 /// <summary>
 /// Gets the User from <paramref name="score"/>
 /// </summary>
 public static HistoryUser GetUser(HistoryScore score, History history)
 {
     return(GetUser(score.UserId, history));
 }
コード例 #5
0
ファイル: Score.cs プロジェクト: Blade12629/Skybot
 public Score(HistoryScore score, HistoryBeatmap beatmap)
 {
     UserScore   = score;
     UserBeatMap = beatmap;
 }