diff --git a/Sources/BowlingApp/BowlingApp.csproj b/Sources/BowlingApp/BowlingApp.csproj index 3e4833f..dbc61aa 100644 --- a/Sources/BowlingApp/BowlingApp.csproj +++ b/Sources/BowlingApp/BowlingApp.csproj @@ -1,5 +1,5 @@ - + Exe net6.0 diff --git a/Sources/BowlingStub/StubEquipe.cs b/Sources/BowlingStub/StubEquipe.cs index ccff2d8..a9e3e12 100644 --- a/Sources/BowlingStub/StubEquipe.cs +++ b/Sources/BowlingStub/StubEquipe.cs @@ -2,48 +2,51 @@ using BowlingLib.Model; using BowlingLib.Interface; using System; -public class StubEquipe:IDataManager -{ - private List listEquipes = new List(); - public StubEquipe() - { +namespace BowlingStub +{ + public class StubEquipe : IDataManager + { + private List listEquipes = new List(); + public StubEquipe() + { + } + + public void Add(Equipe data) + { + listEquipes.Add(data); + } + + public void Delete(Equipe data) + { + listEquipes.Remove(data); + } + + public IEnumerable GetAll(int n = 10, int j = 2) + { + for (int i = 0; i < n; i++) + { + this.Add(new Equipe("Equipe " + i + 1)); + + for (int k = 0; k < j; k++) + { + listEquipes.ElementAt(i).AjouterJoueur(new Joueur("Joueur " + i + 1 + "-" + k + 1)); + + } + } + return listEquipes; + } + + public IEnumerable GetAll() + { + return listEquipes; + } + + //mise à jour d'une équipe + public void Update(Equipe data) + { + int index = listEquipes.FindIndex(x => x.Id == data.Id); + listEquipes[index] = data; + } + } - - public void Add(Equipe data) - { - listEquipes.Add(data); - } - - public void Delete(Equipe data) - { - listEquipes.Remove(data); - } - - public IEnumerable GetAll(int n = 10, int j = 2) - { - for (int i = 0; i < n; i++) - { - this.Add(new Equipe("Equipe " + i + 1)); - - for (int k = 0; k < j; k++) - { - listEquipes.ElementAt(i).AjouterJoueur(new Joueur("Joueur " + i + 1 + "-" + k + 1)); - - } - } - return listEquipes; - } - - public IEnumerable GetAll() - { - return listEquipes; - } - - //mise à jour d'une équipe - public void Update(Equipe data) - { - int index = listEquipes.FindIndex(x => x.Id == data.Id); - listEquipes[index] = data; - } - -} +} \ No newline at end of file diff --git a/Sources/BowlingStub/StubJoueur.cs b/Sources/BowlingStub/StubJoueur.cs index 8bfdfb6..e613044 100644 --- a/Sources/BowlingStub/StubJoueur.cs +++ b/Sources/BowlingStub/StubJoueur.cs @@ -2,40 +2,43 @@ using BowlingLib.Interface; using System; -public class StubJoueur : IDataManager - -{ - private List listJoueurs = new List(); - - - public void Add(Joueur data) - { - listJoueurs.Add(data); - } - - public void Delete(Joueur data) - { - listJoueurs.Remove(data); - } - - public IEnumerable GetAll() - { - return listJoueurs; - } - - public IEnumerable 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; - } - +namespace BowlingStub +{ + public class StubJoueur : IDataManager + + { + private List listJoueurs = new List(); + + + public void Add(Joueur data) + { + listJoueurs.Add(data); + } + + public void Delete(Joueur data) + { + listJoueurs.Remove(data); + } + + public IEnumerable GetAll() + { + return listJoueurs; + } + + public IEnumerable 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; + } + + } }