Final changes

This commit is contained in:
KaseToatz1337
2024-11-11 11:28:17 +01:00
parent 4c01b5ae79
commit 83efd9de1f
5 changed files with 24 additions and 27 deletions

View File

@ -6,6 +6,7 @@
public const int MINPOINTS = 10;
public const int MAXTIME = 10000;
public const int STARTSCORE = 100;
public const int LEADERBOARDSIZE = 10;
public int DeckSize { get; } = deckSize;
public int GridSize { get; } = GetGridSize(deckSize).Rows;
@ -93,7 +94,10 @@
if (IsFinished())
{
CalculateScore(DateTimeOffset.Now.ToUnixTimeMilliseconds());
ScoreHandler.WriteScore(Scoring);
if (ScoreHandler.GetScorePosition(Scoring.Points) <= LEADERBOARDSIZE)
{
ScoreHandler.WriteScore(Scoring);
}
}
}
}

View File

@ -2,7 +2,8 @@
{
public interface IScoreHandler
{
public bool WriteScore(Score score);
public int GetScorePosition(int score);
public void WriteScore(Score score);
public List<Score> GetTopScores();
}
}