using BowlingLib.Model; using System; using Business; namespace BowlingStub { public class StubJoueur : IDataManager { private List listJoueurs = new List(); public async Task Add(Joueur data) { if (data != null) { listJoueurs.Add(data); return true; } return false; } public async Task Delete(Joueur data) { if (data != null) { listJoueurs.Remove(data); return true; } return false; } public async Task> GetAll() { return listJoueurs; } //n represente le nbr de joueurs a creer dans la liste public async Task >GetAllJoueur(int n = 10) { for (int i = 0; i < n; i++) { Add(new Joueur("Joueur " + i + 1)); } return listJoueurs; } ///ged public async TaskGetDataWithId (int id) { throw new NotImplementedException(); } public async Task GetDataWithName(string name) { throw new NotImplementedException(); }// public async Task Update(Joueur data) { if (data != null) { int index = listJoueurs.FindIndex(x => x.Id == data.Id); listJoueurs[index] = data; return true; } return false; } } }