clean: improve code structure

This commit is contained in:
Martin Prokoph
2025-08-01 16:51:14 +02:00
parent 7ef6e246ff
commit 4d175761a5
3 changed files with 17 additions and 19 deletions

View File

@@ -49,12 +49,11 @@ public class Space {
Color[][] tempGameMap = new Color[gameMap.length][gameMap[0].length];
for (int y = 0; y < tempGameMap.length; y++) {
System.arraycopy(gameMap[y], 0, tempGameMap[y], 0, tempGameMap[y].length);
if (currentTetromino != null) {
Color[] newBlobs = currentTetromino.getLine(y);
for (int i = 0; i < newBlobs.length; i++) {
if (newBlobs[i] == null) continue;
tempGameMap[y][i] = newBlobs[i];
}
if (currentTetromino == null) continue;
Color[] newBlobs = currentTetromino.getLine(y);
for (int i = 0; i < newBlobs.length; i++) {
if (newBlobs[i] == null) continue;
tempGameMap[y][i] = newBlobs[i];
}
}