Advertisement
Guest User

copystuff

a guest
Jul 7th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. public void SortByAttack(List<Individual> original)
  2. {
  3.     List<Individual> muhUnitbyAtk = original.OrderBy(o =>o.GetAtk).ToList();
  4.     original.Clear;
  5.     //after this you want to copy the new ordered list into the original
  6.     //there are two wasy that i found
  7.     original = muhUnitbyAtk.ToList(); //I think you need another library for this one
  8.     original.AddRange(muhUnitbyAtk); // this is the one I recommend
  9.    
  10.    
  11.    
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement