Exemplo n.º 1
0
 public static int FindClosestStablePoint(int pos, IntPairCollection positions)
 {
     foreach (IntPair pair in positions)
     {
         if ((pos == pair.Key + 1) || (pos == pair.Key - 1))
         {
             return(pair.Key);
         }
     }
     return(pos);
 }
Exemplo n.º 2
0
 public static int FindClosestStablePoint(int pos, IntPairCollection positions)
 {
     foreach (IntPair pair in positions)
     {
         if ((pos == pair.Key + 1) || (pos == pair.Key - 1)) return pair.Key;
     }
     return pos;
 }