develop-tetris-srs #11

Merged
Pupsi merged 7 commits from develop-tetris-srs into develop 2026-02-06 10:47:27 +00:00
Collaborator

srs und ein lock timer hatten echt noch dringend gefehlt, jetzt ist das Spiel vollendet! (vielleicht)

srs und ein lock timer hatten echt noch dringend gefehlt, jetzt ist das Spiel vollendet! (vielleicht)
Pupsi added 6 commits 2026-02-03 18:26:49 +00:00
MineTec was assigned by Pupsi 2026-02-03 18:27:07 +00:00
MineTec reviewed 2026-02-04 16:04:08 +00:00
@@ -0,0 +20,4 @@
case LEFT -> {
return clockwise ? Orientation.NONE : Orientation.UPSIDE_DOWN;
}
default -> {
Owner

ist default hier überhaupt erreichbar?

ist default hier überhaupt erreichbar?
Pupsi marked this conversation as resolved
MineTec reviewed 2026-02-04 16:04:29 +00:00
@@ -0,0 +3,4 @@
import java.util.Map;
import java.util.stream.IntStream;
public final class RotationChecker {private static final Map<Orientation, int[][]> STANDARD_WALL_KICKS = Map.of(
Owner

zeilenumbruch

zeilenumbruch
Pupsi marked this conversation as resolved
MineTec reviewed 2026-02-04 16:20:39 +00:00
@@ -238,1 +250,3 @@
private void setActiveTetrominoDown() {
private void scheduleTetrominoLock() {
if(this.tetrominoLockTask == null || !this.tetrominoLockTask.isAlive())
this.tetrominoLockTask = this.instance.scheduler().scheduleTask(() -> {
Owner

tasks hierfür fühlen sich falsch an...
Wo kommen die Limits (500ms) her? Ist das im Original auch genau so?

tasks hierfür fühlen sich falsch an... Wo kommen die Limits (500ms) her? Ist das im Original auch genau so?
Author
Collaborator

Ja, die 500ms sind wie in den Tetris Guidelines. Allerdings gibt es dort keinen hard lock task, sondern einen Counter.
Änder ich um.

Ja, die 500ms sind wie in den Tetris Guidelines. Allerdings gibt es dort keinen hard lock task, sondern einen Counter. Änder ich um.
Pupsi marked this conversation as resolved
MineTec reviewed 2026-02-04 16:27:41 +00:00
@@ -65,3 +68,4 @@
}
if(this.lost || this.paused) return;
Owner

hier ein if, welches left, right und rotate abfängt und this.stopTetrominoLockTask(false) macht ist glaub ich schöner als die 3 Methoden, die praktisch nur weiterreichen...

hier ein if, welches `left`, `right` und `rotate` abfängt und `this.stopTetrominoLockTask(false)` macht ist glaub ich schöner als die 3 Methoden, die praktisch nur weiterreichen...
Pupsi marked this conversation as resolved
bytedream reviewed 2026-02-04 17:28:19 +00:00
@@ -0,0 +7,4 @@
UPSIDE_DOWN;
public Orientation rotated(boolean clockwise) {
switch(this) {
Member

Das switch statement ließe sich etwas vereinfachen

return switch(this) {
    case NONE -> clockwise ? Orientation.RIGHT : Orientation.LEFT;
    case RIGHT -> clockwise ? Orientation.UPSIDE_DOWN : Orientation.NONE;
    case UPSIDE_DOWN -> clockwise ? Orientation.LEFT : Orientation.RIGHT;
    case LEFT -> clockwise ? Orientation.NONE : Orientation.UPSIDE_DOWN;
    default -> Orientation.NONE;
}
Das switch statement ließe sich etwas vereinfachen ```java return switch(this) { case NONE -> clockwise ? Orientation.RIGHT : Orientation.LEFT; case RIGHT -> clockwise ? Orientation.UPSIDE_DOWN : Orientation.NONE; case UPSIDE_DOWN -> clockwise ? Orientation.LEFT : Orientation.RIGHT; case LEFT -> clockwise ? Orientation.NONE : Orientation.UPSIDE_DOWN; default -> Orientation.NONE; } ```
Pupsi marked this conversation as resolved
Pupsi added 1 commit 2026-02-04 18:25:08 +00:00
MineTec approved these changes 2026-02-05 10:08:32 +00:00
Pupsi merged commit cbec1ea7f8 into develop 2026-02-06 10:47:27 +00:00
Pupsi deleted branch develop-tetris-srs 2026-02-06 10:47:33 +00:00
Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MineNet/Minigames#11