leaving debug printing and reseting piece position if not placed
This commit is contained in:
parent
334e0ad99b
commit
0f1ecc753b
@ -39,6 +39,7 @@ public class Map extends Shape{
|
|||||||
if(!pieces.contains(piece))
|
if(!pieces.contains(piece))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
piece.setPosition(null);
|
||||||
// In the map limits
|
// In the map limits
|
||||||
if ( pos.x + piece.height > height
|
if ( pos.x + piece.height > height
|
||||||
|| pos.y+piece.width > width
|
|| pos.y+piece.width > width
|
||||||
@ -54,7 +55,6 @@ public class Map extends Shape{
|
|||||||
occupation.add(o);
|
occupation.add(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println(occupation);
|
|
||||||
|
|
||||||
for (int x = pos.x; x < pos.x + piece.height; x++) {
|
for (int x = pos.x; x < pos.x + piece.height; x++) {
|
||||||
for (int y = pos.y; y < pos.y + piece.width; y++) {
|
for (int y = pos.y; y < pos.y + piece.width; y++) {
|
||||||
@ -64,7 +64,6 @@ public class Map extends Shape{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
piece.setPosition(pos);
|
piece.setPosition(pos);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user