Compare commits

..

No commits in common. 'master' and 'BowlingConsoleApp' have entirely different histories.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

@ -44,7 +44,7 @@ l'application vas permettre de:
### Clone
Clone this repo to your local machine using `https://codefirst.iut.uca.fr/git/victor_perez.ngounou/BowlingScoreApp.git`
Clone this repo to your local machine using `https://codefirst.iut.uca.fr/victor_perez.ngounou/BowlingScoreApp.git`
* [Git](https://git-scm.com) - Download and Install Git.
* [Visual Studio](https://visualstudio.microsoft.com/fr/) - Download and Install Visual Studio.
@ -79,7 +79,7 @@ $ dotnet ef database update
## Contributeurs
* [Victor Perez NGOUNOU](https://codefirst.iut.uca.fr/git/victor_perez.ngounou)
* [Victor Perez NGOUNOU](https://codefirst.iut.uca.fr/victor_perez.ngounou)
* [Mamadou Elaphi ARAFA](https://codefirst.iut.uca.fr/git/mamadou_elaphi.arafa)
* [Augustin AFFOGNON](https://codefirst.iut.uca.fr/git/augustin.affognon)
@ -88,7 +88,7 @@ $ dotnet ef database update
Contactez-moi à l'un des endroits suivants !
* Website at <a href="https://codefirst.iut.uca.fr/git/victor_perez.ngounou" target="_blank">`https://codefirst.iut.uca.fr/git/victor_perez.ngounou`</a>
* Website at <a href="https://codefirst.iut.uca.fr/victor_perez.ngounou" target="_blank">`https://codefirst.iut.uca.fr/victor_perez.ngounou`</a>
* Email at <a href="mailto:victor_perez.ngounou@etu.uca.fr" target="_blank">`victor_perez.ngounou@etu.uca.fr`</a>
## License

@ -11,7 +11,7 @@ namespace BowlingLib.Model
/// <summary>
/// Classe Model Equipe
/// </summary>
public class Equipe:IEquatable<Equipe>
public class Equipe
{
#region Propiéters
public string Nom { get; private set; }
@ -53,7 +53,13 @@ namespace BowlingLib.Model
public IEnumerable<Joueur> AjouterJoueurs(params Joueur[] joueurs)
{
List<Joueur> result = new();
result.AddRange(joueurs.Where(a => AjouterJoueur(a)));
foreach (var a in joueurs)
{
if (AjouterJoueur(a))
{
result.Add(a);
}
}
return result;
@ -87,7 +93,12 @@ namespace BowlingLib.Model
{
joueurs.Remove(joueur);
}
/// <summary>
/// retourner la liste non modifiable des joueurs de l'équipe
/// </summary>
/// <returns></returns>
/// <summary>
/// Fonction permettant de vérifier si un joueur existe déjà dans la liste (l'équipe)
@ -100,23 +111,6 @@ namespace BowlingLib.Model
return true;
return false;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(obj, null)) return false;
if (ReferenceEquals(obj, this)) return true;
if (GetType() != obj.GetType()) return false;
return Equals(obj as Equipe);
}
public override int GetHashCode()
{
return joueurs.GetHashCode();
}
public bool Equals(Equipe other)
{
return joueurs.Equals(other.joueurs);
}
#endregion
}

@ -11,7 +11,7 @@ namespace BowlingLib.Model
/// <summary>
/// Classe Model Frame
/// </summary>
public class Frame:IEquatable<Frame>
public class Frame
{
const int MAX_QUILLE = 10;
public int Numero
@ -285,23 +285,5 @@ namespace BowlingLib.Model
this.IsFinished = true;
}
}
public bool Equals(Frame other)
{
return Numero.Equals(other.Numero);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(obj, null)) return false;
if (ReferenceEquals(obj, this)) return true;
if (GetType() != obj.GetType()) return false;
return Equals(obj as Frame);
}
public override int GetHashCode()
{
return Numero.GetHashCode();
}
}
}

@ -5,7 +5,6 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace BowlingLib.Model
{
@ -85,16 +84,9 @@ namespace BowlingLib.Model
public void AddPartie(Partie p)
{
if(Parties.Contains(p))
throw new ArgumentException("la partie existe deja");
parties.Add(p);
}
private string GetDebuggerDisplay()
{
return ToString();
}
#endregion
}
}

@ -10,7 +10,7 @@ namespace BowlingLib.Model
/// <summary>
/// Classe Model Partie
/// </summary>
public class Partie:IEquatable<Partie>
public class Partie
{
#region Propriétés
public ReadOnlyCollection<Frame> Frames { get; }
@ -67,8 +67,6 @@ namespace BowlingLib.Model
/// <param name="frame"></param>
public void AddFrame(Frame frame)
{
if (Frames.Contains(frame))
throw new ArgumentException("Le frame existe déjà");
frames.Add(frame);
}
@ -98,23 +96,6 @@ namespace BowlingLib.Model
}
return score;
}
public bool Equals(Partie other)
{
return Joueur.Equals(Joueur) && Date.Equals(other.Date);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(obj, null)) return false;
if (ReferenceEquals(obj, this)) return true;
if (GetType() != obj.GetType()) return false;
return Equals(obj as Partie);
}
public override int GetHashCode()
{
return Joueur.GetHashCode();
}
#endregion
}
}

Loading…
Cancel
Save