Final changes
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user