You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
960 B
45 lines
960 B
using BowlingLib.Model;
|
|
using BowlingLib.Interface;
|
|
using System;
|
|
|
|
namespace BowlingStub
|
|
{
|
|
public class StubJoueur : IDataManager<Joueur>
|
|
|
|
{
|
|
private List<Joueur> listJoueurs = new List<Joueur>();
|
|
|
|
|
|
public void Add(Joueur data)
|
|
{
|
|
listJoueurs.Add(data);
|
|
}
|
|
|
|
public void Delete(Joueur data)
|
|
{
|
|
listJoueurs.Remove(data);
|
|
}
|
|
|
|
public IEnumerable<Joueur> GetAll()
|
|
{
|
|
return listJoueurs;
|
|
}
|
|
|
|
public IEnumerable<Joueur> GetAll(int n = 10, int j = 0)
|
|
{
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
Add(new Joueur("Joueur " + i + 1));
|
|
}
|
|
return listJoueurs;
|
|
}
|
|
|
|
public void Update(Joueur data)
|
|
{
|
|
int index = listJoueurs.FindIndex(x => x.Id == data.Id);
|
|
listJoueurs[index] = data;
|
|
}
|
|
|
|
}
|
|
}
|