check space helper added
[mc1516pa.git] / modelchecker / coord.c
index be9d36d..f5774a6 100644 (file)
@@ -164,6 +164,17 @@ int check_xy_exists(int x, int y, bimap *bm)
        return res;
 }
 
+int check_space(int x, int y, direction d, int delta, bimap *bm)
+{
+       switch(d){
+       case LEFT: x = x - delta; break;
+       case UP: y = y - delta; break;
+       case RIGHT: x = x + delta; break;
+       case DOWN: y = y + delta; break;
+       }
+       return check_xy_exists(x, y, bm);
+}
+
 /*
  * Each coordinate has three related boolean variables. The combination of those boolean variables
  * defines tiles: