|
|
|
@ -17,6 +17,12 @@ namespace Models.Game
|
|
|
|
|
void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
|
|
|
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The best score of the player on a specific map.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public Dictionary<Map, BestScore> BestScores { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// It is he pseudo of the player.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -62,6 +68,7 @@ namespace Models.Game
|
|
|
|
|
Pseudo = pseudo;
|
|
|
|
|
ProfilePicture = profilePicture;
|
|
|
|
|
CreationDate = DateTime.Now.ToString("dd/MM/yyyy");
|
|
|
|
|
BestScores = new Dictionary<Map, BestScore>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -87,5 +94,21 @@ namespace Models.Game
|
|
|
|
|
{
|
|
|
|
|
return Pseudo.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Actualize the last time the player played.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void UpdateLastPlayed()
|
|
|
|
|
{
|
|
|
|
|
LastPlayed = DateTime.Now.ToString("dd/MM/yyyy");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Add a new best score to the player.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void AddBestScore(Map map, BestScore bestScore)
|
|
|
|
|
{
|
|
|
|
|
BestScores.Add(map, bestScore);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|