Different Kinds of Sort() in 1 Generic List

I am trying to create 2 or more ways to sort a generic list.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

[System.Serializable]
public class HighScore : IComparable<HighScore>
{
    //creating 1st custom sorting order
    public int CompareToScore(HighScore other)
    {
        if (this.score > other.score)
            return 1;
        else if (this.score < other.score)
            return -1;
        else
            return 0;
    }

    //creating 2nd custom sorting order
    public int CompareToTime(HighScore other)
    {
        if (this.timePlayed > other.timePlayed)
            return 1;
        else if (this.timePlayed < other.timePlayed)
            return -1;
        else
            return 0;
    }

    public int score;
    public float timePlayed;

    public HighScore(int s, float t)
    {
        score = s;
        timePlayed = t;
    }
}

public class abcd : MonoBehaviour
{
    public List<HighScore> highscores = new List<HighScore>();

    void Start()
    {
        highscores.Add(new HighScore(2345, 7.2f));
        highscores.Add(new HighScore(3456, 1.6f));
        highscores.Add(new HighScore(5432, 4.65f));
        highscores.Add(new HighScore(7654, 3.5f));
        highscores.Add(new HighScore(4567, 9.45f));
    }

    void SortScore()
    {
        //need help on this part
        highscores.Sort(CompareToScore);
        highscores.Sort.SortScore();
    }

    void SortTime()
    {
        //need help on this part
        highscores.Sort(CompareToTime);
        highscores.Sort.SortTime();
    }
}

Thanks: James

What are you looking for exactly? different ways to call your custom sort methods?

If that’s it then you could just use Linq Library and you dont need to implement IComparable to do sorts on int or floats.

 void SortScore()
{
  highscores.OrderByDescending(x => x.score);
}

 void SortTime()
{
        highscores.OrderByDescending(x => x.timePlayed);
}

or ideas to sort the highscores on extra attributes?

Your class has only 2 attributes at the moment : “score” and “timePlayed”.
I have no idea about your game so I can’t just randomly suggest game data (FragCount? Kda? Accuracy?) that could be relevant to sort.