using System; using EntityFrameWorkLib; using Model; using System.Linq; using Shared; namespace DbDataManager { public class GameManager: IGamesManager { private TrekContext trekcontext; public Task AddCaseValueToPlayer(int idGame, int idPlayer, int value, int index) { throw new NotImplementedException(); } public async Task AddItem(Game? item) { if (item == null) { return null; } var addItem = await trekcontext.AddAsync(item); await trekcontext.SaveChangesAsync(); return addItem.Entity; } public Task AddPlayer(Player player) { throw new NotImplementedException(); } public Task AddScoreToPlayer(int idGame, int idPlayer, int score) { throw new NotImplementedException(); } public Task AddTime(TimeSpan time) { var game = trekcontext.Game.FirstOrDefault(); if (game == null) { return Task.FromResult(false); } game.AddTime(time); return Task.FromResult(true); } public Task AddTurn(Turn turn) { throw new NotImplementedException(); } public Task DeleteItem(Game? item) { throw new NotImplementedException(); } public Task> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false) { throw new NotImplementedException(); } public Task GetNbItems() { throw new NotImplementedException(); } public Task UpdateItem(Game? oldItem, Game? newItem) { throw new NotImplementedException(); } } }