diff --git a/Sources/Stim.Model/Admin.cs b/Sources/Stim.Model/Admin.cs index 63f9737..dcd2e49 100644 --- a/Sources/Stim.Model/Admin.cs +++ b/Sources/Stim.Model/Admin.cs @@ -23,5 +23,14 @@ namespace Model { Permission = perm; } + + public void DelCom (Game game, Review review) + { + if (permission >= 1) + { + game.RemoveReview(review); + } + return; + } } } diff --git a/Sources/Stim.Model/Game.cs b/Sources/Stim.Model/Game.cs index f61b905..516d3f2 100644 --- a/Sources/Stim.Model/Game.cs +++ b/Sources/Stim.Model/Game.cs @@ -82,5 +82,21 @@ namespace Model { Reviews.Remove(review); } + public void DescChange(string newdesc) + { + description = newdesc; + } + public void TagChange(string[] newtag) + { + tags=newtag; + } + public void NameChange(string newname) + { + name = newname; + } + public void yearChange(int newyear) + { + year = newyear; + } } } diff --git a/Sources/Stim.Model/GameHandler.cs b/Sources/Stim.Model/GameHandler.cs new file mode 100644 index 0000000..6de14e7 --- /dev/null +++ b/Sources/Stim.Model/GameHandler.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + internal class GameHandler + { + public List gamesList + { + get { return gamesList} + } + public GameHandler() + { + List gamesList=new List(); + } + } +} diff --git a/Sources/Stim.Model/Persistable.cs b/Sources/Stim.Model/Persistable.cs new file mode 100644 index 0000000..79e9606 --- /dev/null +++ b/Sources/Stim.Model/Persistable.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Model +{ + public interface Persistable + { + public void Load() + { + Console.WriteLine("Todo"); + //To do + } + public void Save(List gamesList) + { + Console.WriteLine("Todo"); + //To do + } + } +} diff --git a/Sources/Stim.Model/Review.cs b/Sources/Stim.Model/Review.cs index d6c1543..94a44c4 100644 --- a/Sources/Stim.Model/Review.cs +++ b/Sources/Stim.Model/Review.cs @@ -36,15 +36,27 @@ namespace Model } private string text; + public string AuthorName + { + get { return authorName; } + private set { authorName = value; } + } + private string authorName; + public Review(float rate, string text) { + AuthorName = authorName; Rate = rate; Text = text; } public void EditReview(string text) { - Text = text; + Text = text+" (Modifié)"; + } + public void EditRate(int newval) + { + rate= newval; } } } diff --git a/Sources/Stim.Model/User.cs b/Sources/Stim.Model/User.cs index f600ff6..7e151bc 100644 --- a/Sources/Stim.Model/User.cs +++ b/Sources/Stim.Model/User.cs @@ -61,5 +61,24 @@ namespace Model Password = password; Followed_Games = new List(); } + public void AddReview(Game game, Review review) + { + game.AddReview(review); + } + public void RemoveSelfReview(Game game, Review review) + { + if (review.AuthorName == username) + { + game.RemoveReview(review); + } + } + public void FollowAGame(Game game) + { + Followed_Games.Add(game); + } + public void RemoveAGame(Game game) + { + Followed_Games.Remove(game); + } } }