31 lines
884 B
C#
31 lines
884 B
C#
// 一次遊玩的統計,給結算/上傳使用
|
|
public class PlayResult
|
|
{
|
|
public int score;
|
|
public int perfect, fast, slow, bad, miss;
|
|
public int maxCombo;
|
|
public int combo;
|
|
|
|
public static PlayResult Last { get; set; }
|
|
|
|
public void Add(Judgement j, int points)
|
|
{
|
|
score += points;
|
|
switch (j)
|
|
{
|
|
case Judgement.Perfect: perfect++; break;
|
|
case Judgement.Fast: fast++; break;
|
|
case Judgement.Slow: slow++; break;
|
|
case Judgement.Bad: bad++; break;
|
|
case Judgement.Miss: miss++; break;
|
|
}
|
|
|
|
if (j == Judgement.Miss) combo = 0;
|
|
else if (j != Judgement.None) combo++;
|
|
if (combo > maxCombo) maxCombo = combo;
|
|
}
|
|
|
|
public override string ToString() =>
|
|
$"score={score} P={perfect} F={fast} S={slow} B={bad} M={miss} maxCombo={maxCombo}";
|
|
}
|