using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace MusiLib.Model
{
    [DataContract]
    public class Utilisateur
    {
        [DataMember]
        public static int IdTotal = 0;
        [DataMember]
        public int IdUtilisateur { get; private set; }
        [DataMember]
        public string Nom { get; private set; }
        [DataMember]
        public List<Partition> Favoris { get; private set; }


        public Utilisateur(string nom)
        {
            IdUtilisateur = IdTotal+1;
            Nom = nom;
            Favoris = new List<Partition>();
        }


        public void ajouter(Partition partition)
        {
            Favoris.Add(partition);
        }

        public void retirer(Partition partition)
        {
            Favoris.Remove(partition);
        }

        public void retirerTout()
        {
            Favoris.Clear();
        }

    }

}
