using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Model.Dice; using Model.Dice.Faces; using Model.Players; namespace Model.Games { public class GameRunner { private readonly IManager globalPlayerManager; private readonly IManager>>> globalDieManager; private readonly List games; public GameRunner(IManager globalPlayerManager, IManager>>> globalDieManager, List games) { this.globalPlayerManager = globalPlayerManager; this.globalDieManager = globalDieManager; this.games = games ?? new(); } public IEnumerable GetAllGames() => games.AsEnumerable(); /// /// finds the game with that name and returns it ///
/// that copy does not belong to this gamerunner's games, so it should not be modified ///
/// a games's name /// game with said name, or null if no such game was found public Game GetOneGameByName(string name) { if (!string.IsNullOrWhiteSpace(name)) { Game result = games.FirstOrDefault(g => g.Name == name); return result; // may return null } throw new ArgumentException("param should not be null or blank", nameof(name)); } /// /// saves a given game /// /// a game to save /// public void SaveGame(Game game) { throw new NotSupportedException(); } /// /// loads a game by name /// /// name of game to be loaded /// loaded game /// public Game LoadGame(string name) { throw new NotSupportedException(); } /// /// creates a new game /// /// public void StartNewGame() { throw new NotSupportedException(); } public void DeleteGame(Game game) { throw new NotSupportedException(); } private void PlayGame(Game game) { throw new NotSupportedException(); } } }