This commit is contained in:
mike
2026-01-24 00:46:10 +01:00
parent 2a5b70896e
commit 3cc6570cdc
11 changed files with 88 additions and 72 deletions

View File

@@ -3,6 +3,7 @@ package puzzle;
import lombok.AllArgsConstructor;
import lombok.experimental.Delegate;
import lombok.val;
import precomp.Mask;
import puzzle.Masker.Slot;
import puzzle.Meta.ShardLem;
import puzzle.SwedishGenerator.Lemma;
@@ -87,20 +88,6 @@ public class Riddle {
public record Vestigium(int index, int clue) { }
record Placed(long lemma, int slotKey, rci[] cells) {
public static final char HORIZONTAL = 'h';
static final char VERTICAL = 'v';
static final char[] DIRECTION = { Placed.VERTICAL, Placed.HORIZONTAL, Placed.VERTICAL, Placed.HORIZONTAL, Placed.VERTICAL, Placed.VERTICAL };
public int arrowCol() { return cells[0].c(); }
public int arrowRow() { return cells[0].r(); }
public int startRow() { return cells[1].r(); }
public int startCol() { return cells[1].c(); }
public boolean isReversed() { return !Slotinfo.increasing(slotKey); }
public char direction() { return DIRECTION[Slot.dir(slotKey)]; }
}
public record ExportedPuzzle(String[] grid, WordOut[] words, int difficulty, Rewards rewards) { }
public record Rewards(int coins, int stars, int hints) { }
@@ -174,4 +161,18 @@ public class Riddle {
return stream.build();
}
}
public record Placed(long lemma, int slotKey, Mask[] cells) {
public static final char HORIZONTAL = 'h';
static final char VERTICAL = 'v';
static final char[] DIRECTION = { Placed.VERTICAL, Placed.HORIZONTAL, Placed.VERTICAL, Placed.HORIZONTAL, Placed.VERTICAL, Placed.VERTICAL };
public int arrowCol() { return cells[0].c(); }
public int arrowRow() { return cells[0].r(); }
public int startRow() { return cells[1].r(); }
public int startCol() { return cells[1].c(); }
public boolean isReversed() { return !Slotinfo.increasing(slotKey); }
public char direction() { return DIRECTION[Slot.dir(slotKey)]; }
}
}