Commit 663ee50c authored by hosein's avatar hosein

playground -> cleaned warnings

parent cd25f5fa
......@@ -74,22 +74,14 @@ public class PlayGround {
return positions;
}
public void change(int[][] newPolicesSituation, int xThief, int yThief) {
int i, j;
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
ground[i][j] = 0;
for (i = 0; i < policeNumbers; i++)
ground[newPolicesSituation[i][0]][newPolicesSituation[i][1]] = 1;
ground[xThief][yThief] = -1;
}
public void changeSituation(int xPrevious, int yPrevious, int xNew, int yNew, int k) {
if (xNew == thiefSituation[0][0] && yNew == thiefSituation[0][1]) return;
if (xNew == thiefSituation[0][0] && yNew == thiefSituation[0][1] && k == 1) return;
ground[xPrevious][yPrevious] = 0;
ground[xNew][yNew] = k;
if (k == -1) {
thiefSituation[0][0] = xNew;
thiefSituation[0][1] = yNew;
}
}
......@@ -121,15 +113,6 @@ public class PlayGround {
return null;
}
public boolean catchThief() {
int i, j;
for (i = 0; i < n; i++)
for (j = 0; j < m; j++)
if (ground[i][j] == 100)
return true;
return false;
}
public boolean isEmpty(int x, int y) {
if (ground[x][y] == -1) {
catchThief = true;
......@@ -145,15 +128,8 @@ public class PlayGround {
return ret;
}
public int[][] getThiefSituation() {
int[][] ret = new int[1][2];
ret[0][0] = thiefSituation[0][0];
ret[0][1] = thiefSituation[0][1];
return ret;
}
public boolean getCatchThief() {
return catchThief;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment