using BowlingLib.Model; using Business; namespace BowlingStub { public class StubPartie:IDataManager { private List listParties = new List(); public async Task Add(Partie data) { if (data != null) { listParties.Add(data); return true; } return false; } public async Task Delete(Partie data) { if (data != null) { listParties.Remove(data); return true; } return false; } public async Task> GetAll() { return listParties; } public IEnumerable GetAllPartie(int n=10, int j=0) { for (int i = 0; i < n; i++) { listParties.Add(new Partie(new Joueur("Joueur " + i + 1))); } return listParties; } //GDW? public async Task GetDataWithId(int id) { throw new NotImplementedException(); } public async Task GetDataWithName(string name) { throw new NotImplementedException(); } public async Task Update(Partie data) { if (data != null) { int index = listParties. FindIndex(x => x.Id == data.Id); listParties[index] = data; } return false; } } }