diff --git a/Qwirkle/QwirkleClassLibrary/Events/AddPlayerNotifiedEventArgs.cs b/Qwirkle/QwirkleClassLibrary/Events/AddPlayerNotifiedEventArgs.cs index 5969f87..da92a31 100644 --- a/Qwirkle/QwirkleClassLibrary/Events/AddPlayerNotifiedEventArgs.cs +++ b/Qwirkle/QwirkleClassLibrary/Events/AddPlayerNotifiedEventArgs.cs @@ -2,11 +2,11 @@ { public class AddPlayerNotifiedEventArgs : EventArgs { - public string returnedNotified { get; private set; } + public string ReturnedNotified { get; private set; } public AddPlayerNotifiedEventArgs(string returnedNotified) { - this.returnedNotified = returnedNotified; + ReturnedNotified = returnedNotified; } } } \ No newline at end of file diff --git a/Qwirkle/QwirkleClassLibrary/Events/EndOfGameNotifiedEventArgs.cs b/Qwirkle/QwirkleClassLibrary/Events/EndOfGameNotifiedEventArgs.cs index b36f906..b691baa 100644 --- a/Qwirkle/QwirkleClassLibrary/Events/EndOfGameNotifiedEventArgs.cs +++ b/Qwirkle/QwirkleClassLibrary/Events/EndOfGameNotifiedEventArgs.cs @@ -4,11 +4,11 @@ namespace QwirkleClassLibrary.Events { public class EndOfGameNotifiedEventArgs { - public Player player { get; private set; } + public Player Player { get; private set; } public EndOfGameNotifiedEventArgs(Player player) { - this.player = player; + this.Player = player; } } } \ No newline at end of file diff --git a/Qwirkle/QwirkleClassLibrary/Events/NextPlayerNotifiedEventArgs.cs b/Qwirkle/QwirkleClassLibrary/Events/NextPlayerNotifiedEventArgs.cs index 967ca26..06207b0 100644 --- a/Qwirkle/QwirkleClassLibrary/Events/NextPlayerNotifiedEventArgs.cs +++ b/Qwirkle/QwirkleClassLibrary/Events/NextPlayerNotifiedEventArgs.cs @@ -4,11 +4,11 @@ namespace QwirkleClassLibrary.Events { public class NextPlayerNotifiedEventArgs : EventArgs { - public Player player { get; private set; } + public Player Player { get; private set; } public NextPlayerNotifiedEventArgs(Player player) { - this.player = player; + this.Player = player; } } } \ No newline at end of file diff --git a/Qwirkle/QwirkleClassLibrary/Events/PlaceTileNotifiedEventArgs.cs b/Qwirkle/QwirkleClassLibrary/Events/PlaceTileNotifiedEventArgs.cs index 9608417..c79ce62 100644 --- a/Qwirkle/QwirkleClassLibrary/Events/PlaceTileNotifiedEventArgs.cs +++ b/Qwirkle/QwirkleClassLibrary/Events/PlaceTileNotifiedEventArgs.cs @@ -4,14 +4,14 @@ namespace QwirkleClassLibrary.Events { public class PlaceTileNotifiedEventArgs : EventArgs { - public Tile tile { get; private set; } + public Tile Tile { get; private set; } - public string reason { get; private set; } + public string Reason { get; private set; } public PlaceTileNotifiedEventArgs(Tile tile, string reason) { - this.tile = tile; - this.reason = reason; + this.Tile = tile; + this.Reason = reason; } } } \ No newline at end of file diff --git a/Qwirkle/QwirkleClassLibrary/Players/Leaderboard.cs b/Qwirkle/QwirkleClassLibrary/Players/Leaderboard.cs index 2b7141d..4cd16db 100644 --- a/Qwirkle/QwirkleClassLibrary/Players/Leaderboard.cs +++ b/Qwirkle/QwirkleClassLibrary/Players/Leaderboard.cs @@ -10,27 +10,26 @@ namespace QwirkleClassLibrary.Players { public class Leaderboard { - public ReadOnlyCollection LB => leaderb.AsReadOnly(); - private readonly List leaderb = new(); - public Leaderboard() { } - - + public ReadOnlyCollection Lb => leaderboard.AsReadOnly(); + private readonly List leaderboard = new(); + public int IsPlayerIn(Player player) { - for (int i = 0; i < leaderb.Count; i++) + for (int i = 0; i < leaderboard.Count; i++) { - if (player.NameTag == leaderb[i].PlayerName) + if (player.NameTag == leaderboard[i].PlayerName) { return i; } } return -1; } - public void AddScoreInLead(ReadOnlyDictionary ScoreBoard) + + public void AddScoreInLead(ReadOnlyDictionary scoreBoard) { DateTime now = DateTime.Today; bool first = true; - var sb = ScoreBoard.OrderByDescending(x => x.Value).ThenBy(x => x.Key.NameTag); + var sb = scoreBoard.OrderByDescending(x => x.Value).ThenBy(x => x.Key.NameTag); foreach (KeyValuePair pair in sb) { @@ -39,14 +38,14 @@ namespace QwirkleClassLibrary.Players if (i != -1) { - leaderb[i].Date = now; + leaderboard[i].Date = now; if (first) { - leaderb[i].Victories++; + leaderboard[i].Victories++; } - leaderb[i].Points = pair.Value; + leaderboard[i].Points = pair.Value; } else @@ -57,7 +56,7 @@ namespace QwirkleClassLibrary.Players v = 1; } Score score = new Score(pair.Key.NameTag, now, pair.Value, v); - leaderb.Add(score); + leaderboard.Add(score); } first = false; diff --git a/Qwirkle/QwirkleConsoleApp/NotificationClass.cs b/Qwirkle/QwirkleConsoleApp/NotificationClass.cs index 4f05a50..5c6a130 100644 --- a/Qwirkle/QwirkleConsoleApp/NotificationClass.cs +++ b/Qwirkle/QwirkleConsoleApp/NotificationClass.cs @@ -14,7 +14,7 @@ namespace QwirkleConsoleApp { ForegroundColor = ConsoleColor.Yellow; WriteLine(); - WriteLine(args.returnedNotified); + WriteLine(args.ReturnedNotified); WriteLine(); ResetColor(); } @@ -23,7 +23,7 @@ namespace QwirkleConsoleApp { ForegroundColor = ConsoleColor.Yellow; WriteLine(); - WriteLine(args.player.NameTag + "'s turn"); + WriteLine(args.Player.NameTag + "'s turn"); WriteLine(); ResetColor(); } @@ -32,7 +32,7 @@ namespace QwirkleConsoleApp { ForegroundColor = ConsoleColor.Magenta; WriteLine(); - WriteLine("The tile [" + args.tile.ToString() + "] " + args.reason); + WriteLine("The tile [" + args.Tile.ToString() + "] " + args.Reason); WriteLine(); ResetColor(); } @@ -41,7 +41,7 @@ namespace QwirkleConsoleApp { ForegroundColor = ConsoleColor.Red; WriteLine(); - WriteLine("This end of game ! The last player is " + args.player.NameTag + " !"); + WriteLine("This end of game ! The last player is " + args.Player.NameTag + " !"); WriteLine(); ResetColor(); diff --git a/Qwirkle/QwirkleConsoleApp/Program.cs b/Qwirkle/QwirkleConsoleApp/Program.cs index c0bbcdc..d24d141 100644 --- a/Qwirkle/QwirkleConsoleApp/Program.cs +++ b/Qwirkle/QwirkleConsoleApp/Program.cs @@ -263,9 +263,9 @@ static void ShowLeaderboard(Leaderboard leaderboard) WriteLine(" --------------------- THE LEADERBOARD : ---------------------"); WriteLine("Position : | PlayerTag : | Last Date : | Points : | Victories :"); - for (int i=0; i