using MusiLib.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace App.Models
{
    class Trier 
    {

        public List<Partition> partitions = new List<Partition>();

        public List<Partition> parNom(List<Partition> liste)
        {
            Comparer<Partition> comparer = Comparer<Partition>.Create((p1, p2) => p1.Nom.CompareTo(p2.Nom));
            liste.Sort(comparer);
            return liste;
        }

        public List<Partition> parComplexite(List<Partition> liste)
        {
            Comparer<Partition> comparer = Comparer<Partition>.Create((p1, p2) => p1.Complexite.CompareTo(p2.Complexite));
            liste.Sort(comparer);
            return liste;
        }

        public List<Partition> parInstrument(List<Partition> liste)
        {
            Comparer<Partition> comparer = Comparer<Partition>.Create((p1, p2) => p1.Instrument.CompareTo(p2.Instrument));
            liste.Sort(comparer);
            return liste;
        }

    }
}
