From cb3926b3f6cb740367cc032e920e42b01ac6540e Mon Sep 17 00:00:00 2001 From: Anthony RICHARD Date: Wed, 26 Apr 2023 17:22:34 +0200 Subject: [PATCH] Ajout de la classe User --- Sources/Stim/Stim/User.cs | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Sources/Stim/Stim/User.cs diff --git a/Sources/Stim/Stim/User.cs b/Sources/Stim/Stim/User.cs new file mode 100644 index 0000000..8ba6864 --- /dev/null +++ b/Sources/Stim/Stim/User.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Stim +{ + internal class User + { + static int nbUser=0; + public int Id { get; } + public string Username { get; set; } + public string Biographie { get; set; } + public string Email { get; set; } + public string Password { get; set; } + public List Games { get; set; } + + public User(string username, string biographie, string email, string password) + { + nbUser++; + Id = nbUser; + + Username = username; + Biographie = biographie; + Email = email; + Password = password; + Games = new List(); + } + + public void AddGame(Game game) + { + Games.Add(game); + } + + public void RemoveGame(Game game) + { + Games.Remove(game); + } + } +}