You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
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;
|
|
}
|
|
|
|
}
|
|
}
|