From 4813c4cf81c7f6c4e2bcd8597f7d459c018927e0 Mon Sep 17 00:00:00 2001 From: pirousse <pierre.roussel@etu.utc.fr> Date: Mon, 14 Nov 2022 16:55:10 +0100 Subject: [PATCH] Fixing code issues --- .../data/Comm_calls_Data_Server_Impl.cs | 7 +---- vs/LO23/Shared/data/Card.cs | 15 ++++++---- vs/LO23/Shared/data/ChatMessage.cs | 27 +++++++++-------- vs/LO23/Shared/data/Deck.cs | 12 ++++---- vs/LO23/Shared/data/Game.cs | 2 +- vs/LO23/Shared/data/LightGame.cs | 2 +- vs/LO23/Shared/data/LightUser.cs | 2 +- vs/LO23/Shared/data/Phase.cs | 3 -- vs/LO23/Shared/data/Player.cs | 30 ++++++++++--------- vs/LO23/Shared/data/User.cs | 1 - 10 files changed, 51 insertions(+), 50 deletions(-) diff --git a/vs/LO23/Server/data/Comm_calls_Data_Server_Impl.cs b/vs/LO23/Server/data/Comm_calls_Data_Server_Impl.cs index 8f7f74c..6917410 100644 --- a/vs/LO23/Server/data/Comm_calls_Data_Server_Impl.cs +++ b/vs/LO23/Server/data/Comm_calls_Data_Server_Impl.cs @@ -12,11 +12,6 @@ namespace Server.Data private static List<LightUser> users = new List<LightUser>(); private static List<LightGame> games = new List<LightGame>(); - public Comm_calls_Data_Server_Impl() - { - - } - public Comm_calls_Data_Server_Impl() { this.user = new LightUser(); @@ -39,7 +34,7 @@ namespace Server.Data { foreach(LightUser user in users) { - if(user.getIdJoueur() == idJoueur) + if(user.id == idJoueur) { users.Remove(user); break; diff --git a/vs/LO23/Shared/data/Card.cs b/vs/LO23/Shared/data/Card.cs index e279418..566ede6 100644 --- a/vs/LO23/Shared/data/Card.cs +++ b/vs/LO23/Shared/data/Card.cs @@ -1,10 +1,13 @@ using System; -public class Card +namespace Shared.data { - private int index; - private char color; - private int value; - private bool isInHand; - private bool isHidden; + public class Card + { + private int index; + private char color; + private int value; + private bool isInHand; + private bool isHidden; + } } diff --git a/vs/LO23/Shared/data/ChatMessage.cs b/vs/LO23/Shared/data/ChatMessage.cs index e1b0783..a76f212 100644 --- a/vs/LO23/Shared/data/ChatMessage.cs +++ b/vs/LO23/Shared/data/ChatMessage.cs @@ -1,18 +1,21 @@ using System; -public class ChatMessage +namespace Shared.data { - private DateTime date; - private string sender; // username sera passé en paramètre - private string text; - private int idGame; - - /* public Message(DateTime datet, string sendert, string textt, int idGamet) + public class ChatMessage { - date = datet; - sender = sendert; - text = textt; - idGame = idGamet; - }*/ + private DateTime date; + private string sender; // username sera passé en paramètre + private string text; + private int idGame; + + /* public Message(DateTime datet, string sendert, string textt, int idGamet) + { + date = datet; + sender = sendert; + text = textt; + idGame = idGamet; + }*/ + } } diff --git a/vs/LO23/Shared/data/Deck.cs b/vs/LO23/Shared/data/Deck.cs index 7a73283..45feee8 100644 --- a/vs/LO23/Shared/data/Deck.cs +++ b/vs/LO23/Shared/data/Deck.cs @@ -1,8 +1,10 @@ using System; -using static Card; -public class Deck +namespace Shared.data { - private int index; - private Card[] cards; -} \ No newline at end of file + public class Deck + { + private int index; + private Card[] cards; + } +} diff --git a/vs/LO23/Shared/data/Game.cs b/vs/LO23/Shared/data/Game.cs index 1679b63..3793ee9 100644 --- a/vs/LO23/Shared/data/Game.cs +++ b/vs/LO23/Shared/data/Game.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Shared.data { - class Game + public class Game { Round[] rounds { get; set; } int turn { set; get; } diff --git a/vs/LO23/Shared/data/LightGame.cs b/vs/LO23/Shared/data/LightGame.cs index 633279a..ff5370b 100644 --- a/vs/LO23/Shared/data/LightGame.cs +++ b/vs/LO23/Shared/data/LightGame.cs @@ -14,7 +14,7 @@ namespace Shared.data finished = 3 } - public class LightGame + public class LightGame { int id { get; set; } GameStatus status { get; set; } diff --git a/vs/LO23/Shared/data/LightUser.cs b/vs/LO23/Shared/data/LightUser.cs index ee3a172..4128d86 100644 --- a/vs/LO23/Shared/data/LightUser.cs +++ b/vs/LO23/Shared/data/LightUser.cs @@ -10,7 +10,7 @@ namespace Shared.data public class LightUser { - public int id; + public int id { get; set; } public string userName;// userName et login c'est la même chose public string image; diff --git a/vs/LO23/Shared/data/Phase.cs b/vs/LO23/Shared/data/Phase.cs index 8e1cea7..1f316bf 100644 --- a/vs/LO23/Shared/data/Phase.cs +++ b/vs/LO23/Shared/data/Phase.cs @@ -18,9 +18,6 @@ namespace Shared.data public class Phase { GameAction[] actions { set; get; } - - - } } \ No newline at end of file diff --git a/vs/LO23/Shared/data/Player.cs b/vs/LO23/Shared/data/Player.cs index 24acaa9..0ab76f4 100644 --- a/vs/LO23/Shared/data/Player.cs +++ b/vs/LO23/Shared/data/Player.cs @@ -1,18 +1,20 @@ using System; -using static Card; -enum PlayerRole : ushort { - smallBlind = 1, - bigBlind = 2, - nothing = 3 -} - -public class Player +namespace Shared.data { - private PlayerRole role; - private bool isFolded; - private int tokens; - private int tokensBet; - private Card[] hand; -} + enum PlayerRole : ushort + { + smallBlind = 1, + bigBlind = 2, + nothing = 3 + } + public class Player + { + private PlayerRole role; + private bool isFolded; + private int tokens; + private int tokensBet; + private Card[] hand; + } +} diff --git a/vs/LO23/Shared/data/User.cs b/vs/LO23/Shared/data/User.cs index 88ed88f..9e45574 100644 --- a/vs/LO23/Shared/data/User.cs +++ b/vs/LO23/Shared/data/User.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Shared.data; namespace Shared.data { -- GitLab