Ajout de BestScore.cs avec la class qui va avec

pull/36/head
Remi NEVEU 1 year ago
parent 065f02cf0a
commit 7698826fdf

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
{
public class BestScore
{
public BestScore(int gamesPlayed, int score)
{
GamesPlayed = gamesPlayed;
Score = score;
}
public int GamesPlayed { get; private set; }
public int Score
{
get
{
return Score;
}
private set
{
if (value > Score)
Score = value;
return Score;
}
}
public override string ToString()
{
return $"Ce joueur a joué {GamesPlayed} parties et à pour meilleur score {Score}";
}
public void IncrGamesPlayed()
{
GamesPlayed += 1;
}
}
}
Loading…
Cancel
Save