/// <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)); }
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); } }
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); } }
/// <summary> /// Gets the User from <paramref name="score"/> /// </summary> public static HistoryUser GetUser(HistoryScore score, History history) { return(GetUser(score.UserId, history)); }
public Score(HistoryScore score, HistoryBeatmap beatmap) { UserScore = score; UserBeatMap = beatmap; }