Example #1
0
 private int CompareByDistance(IRollable a, IRollable b)  //使用List 內定的 Sort時, 回傳型態是整數
 {
     if (a.Distance() > b.Distance())
     {
         return(-1);
     }
     else
     {
         return(1);
     }
 }
Example #2
0
 private int CompareDistance(IRollable a, IRollable b)
 {
     if (a.Distance() < b.Distance())
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }