public class StructComparer : IComparer
{
public int CompareStructs(object x, object y)
{
if (!(x is YourStruct) || !(y is YourStruct)) return 0;
YourStruct a = (YourStruct)x;
YourStruct b = (YourStruct)y;
return a.HighScore.CompareTo(b.HighScore);
}
}
//when you want to sort...
yourArrayList.Sort(new StructComparer());
I don't think you can sort structs. For sorting to work in C# you have to implement the IComparer interface, which basically is done by overriding the Compare function. As structs can't have methods you'll have to use a class for that.