From 40a09b09afa38e2702c141186e6f433383f1c66d Mon Sep 17 00:00:00 2001 From: Roxane ROSSETTO Date: Thu, 27 Apr 2023 09:55:15 +0200 Subject: [PATCH] beginning of model user and enum priority --- MCTG/MCTGLib/Priority.cs | 17 +++++++++++ MCTG/MCTGLib/User.cs | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 MCTG/MCTGLib/Priority.cs create mode 100644 MCTG/MCTGLib/User.cs diff --git a/MCTG/MCTGLib/Priority.cs b/MCTG/MCTGLib/Priority.cs new file mode 100644 index 0000000..9fe220a --- /dev/null +++ b/MCTG/MCTGLib/Priority.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MCTGLib +{ + /// + /// This is the list of priorities that user can define in his profil. Priorities + /// are also present in recipes to match the first user's priority with the recipe's priority. + /// + public class Priority + { + enum UserPriority { Economic, Fast, Easy, Light, Gourmet }; + } +} diff --git a/MCTG/MCTGLib/User.cs b/MCTG/MCTGLib/User.cs new file mode 100644 index 0000000..be9199d --- /dev/null +++ b/MCTG/MCTGLib/User.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Collections; +using System.Collections.ObjectModel; +using System.Threading.Tasks; + +namespace MCTGLib +{ + /// + /// A user is an entity with a name, a surname, mail, profilePict and a list of priority. + /// This user can login with a Id and password + /// + public class User + { + #region Private Attributes + + private string Name; + private string Surname; + private string Mail; + ///private ICollection _priorities = new List(); + + #endregion + + #region Public Properties + /// + /// User's Name + /// + + private string picture; + public string ProfilPict + { + get => picture; + set + { + picture = value; + if (picture == null) + { + picture = "PhotoParDefaut"; + } + } + + } + + #endregion + + + #region Constructors + + /// + /// Construtors of user. + /// + public User(string name, string surname, string mail, params Priority[] priorities ) + { + Name = name; + Surname = surname; + Mail = mail; + ///_priorities = new List(priorities); + } + + #endregion + + + } +}