From de7062e81d61ee3faaace71f969e9ef84d234c46 Mon Sep 17 00:00:00 2001 From: Alexis DRAI Date: Sat, 24 Sep 2022 23:37:53 +0200 Subject: [PATCH] Synchronise Wiki and Model --- Sources/Model/Games/GameRunner.cs | 22 +++++++++++++++++++++- Sources/Model/Games/Turn.cs | 7 ++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Sources/Model/Games/GameRunner.cs b/Sources/Model/Games/GameRunner.cs index 070cdff..a3aefdc 100644 --- a/Sources/Model/Games/GameRunner.cs +++ b/Sources/Model/Games/GameRunner.cs @@ -22,7 +22,7 @@ namespace Model.Games this.games = games ?? new(); } - public IEnumerable GetAll() => games.AsEnumerable(); + public IEnumerable GetAllGames() => games.AsEnumerable(); /// /// finds the game with that name and returns it @@ -40,5 +40,25 @@ namespace Model.Games } throw new ArgumentException("param should not be null or blank", nameof(name)); } + + public void SaveGame(Game game) + { + throw new NotSupportedException(); + } + + public Game LoadGame(string name) + { + throw new NotSupportedException(); + } + + public void StartNewGame() + { + throw new NotSupportedException(); + } + + public void DeleteGame(Game game) + { + throw new NotSupportedException(); + } } } diff --git a/Sources/Model/Games/Turn.cs b/Sources/Model/Games/Turn.cs index 7b2abca..49bf381 100644 --- a/Sources/Model/Games/Turn.cs +++ b/Sources/Model/Games/Turn.cs @@ -33,7 +33,8 @@ namespace Model.Games /// /// the collection of Face that were rolled /// - public Dictionary, AbstractDieFace> DiceNFaces { get; } + public IEnumerable, AbstractDieFace>> DiceNFaces => diceNFaces.AsEnumerable(); + private readonly Dictionary, AbstractDieFace> diceNFaces; /// /// this private constructor is to be used only by factories @@ -45,7 +46,7 @@ namespace Model.Games { When = when; Player = player; - DiceNFaces = diceNFaces; + this.diceNFaces = diceNFaces; } /// @@ -107,7 +108,7 @@ namespace Model.Games date, time, Player.ToString()); - foreach (AbstractDieFace face in DiceNFaces.Values) + foreach (AbstractDieFace face in this.diceNFaces.Values) { sb.Append(" " + face.ToString()); }