Esempio n. 1
0
 private void merge(int x, int y, ref BoardObject[] result)
 {
     if (!BoardObjects.isValidCoords(x, y))
     {
         return;
     }
     BoardObject[] boardObjectsFromCoords = BoardObjects.getBoardObjectsFromCoords(x, y);
     if (boardObjectsFromCoords.Length != 0)
     {
         ArrayUtils.merge(ref result, boardObjectsFromCoords);
     }
 }
Esempio n. 2
0
 private void mergeWithoutAnt(int x, int y, ref BoardObject[] result)
 {
     BoardObject[] boardObjectsFromCoords = BoardObjects.getBoardObjectsFromCoords(x, y).Clone() as BoardObject[];
     if (boardObjectsFromCoords.Length - 1 != 0)
     {
         for (int i = 0; i < boardObjectsFromCoords.Length; i++)
         {
             BoardObject obj = boardObjectsFromCoords[i];
             if (obj.isAnt())
             {
                 ArrayUtils.remove(ref boardObjectsFromCoords, obj);
                 break;
             }
         }
         ArrayUtils.merge(ref result, boardObjectsFromCoords);
     }
 }