|
|
|
@ -96,6 +96,9 @@ namespace Model
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<InfoTitle> infoTitles = new ObservableCollection<InfoTitle>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Constructeur de la classe album
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Album(string name, string imageURL, Artist artist, string description, string information)
|
|
|
|
|
{
|
|
|
|
|
id = nbAlbum;
|
|
|
|
@ -106,22 +109,36 @@ namespace Model
|
|
|
|
|
Description = description;
|
|
|
|
|
Information = information;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Constructeur par défaut de la classe album
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Album()
|
|
|
|
|
{
|
|
|
|
|
Artist = new Artist(Manager.DEFAULT_NAME);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Permet d'ajouter l'InfoTitle passé en paramètre à la liste
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="title"></param>
|
|
|
|
|
public void AddTitle(InfoTitle title)
|
|
|
|
|
{
|
|
|
|
|
infoTitles.Add(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Permet de supprimer l'InfoTitle passé en paramètre si il est présent dans la liste
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="title"></param>
|
|
|
|
|
public void RemoveTitle(InfoTitle title)
|
|
|
|
|
{
|
|
|
|
|
infoTitles.Remove(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fonction qui permet de déterminer si deux objets Album sont égaux
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="obj"></param>
|
|
|
|
|
/// <returns>Un booléen indiquant si l'objet est égal</returns>
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is null) return false;
|
|
|
|
@ -129,12 +146,19 @@ namespace Model
|
|
|
|
|
if (obj is Album album && Name == album.Name) return true;
|
|
|
|
|
else return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Permet de déterminer le hash d'un objet Album
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>hash de l'attribut ImageURL</returns>
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return ImageURL.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Permet de convertir un objet Album en string
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>une nouvelle chaîne caractères contenant le nom de l'album et le nom de l'artiste</returns>
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"Name : {Name}, Artist : {Artist}";
|
|
|
|
|