I think you can write an inherited class from IComparer to tell the code how to sort your list. I believe this code works - haven't gotten to multiplayer testing yet so it might need some tweaking.
using System.Collections.Generic;
public class AggroComparer : IComparer
{
public int Compare(AggroData x, AggroData y)
{
if (x.AggroLevel == y.AggroLevel)
{
return 0;
}
if (y.AggroLevel > x.AggroLevel)
{
return 1;
}
else return -1;
}
}
↧