Example #1
0
 public Block[] getNeighbours(Block b)
 {
     int[] id = b.getPlaygroundID();
     int yVal = id[0];
     int xVal = id[1];
     Block[] ret = { null, null, null };
     try
     {
         ret[0] = arr[yVal, xVal - 1];
     }
     catch (Exception e)
     {
         //skip
     }
     try
     {
         ret[1] = arr[yVal+1, xVal];
     }
     catch (Exception e)
     {
         //skip
     }
     try
     {
         ret[2] = arr[yVal, xVal + 1];
     }
     catch (Exception e)
     {
         //skip
     }
     return ret;
 }
Example #2
0
 public void updateBlock(Block b)
 {
     int[] id = b.getPlaygroundID();
     arr[id[0], id[1]] = null;
     addBlock(b);
 }