merge
All checks were successful
Linux arm64 / Build (push) Successful in 24m8s

This commit is contained in:
Melvyn
2025-01-24 16:17:56 +01:00
parent 981bf8529d
commit 8f4330f710
21 changed files with 42 additions and 45 deletions

View File

@@ -0,0 +1,42 @@
package sudoku.structure;
import java.util.ArrayList;
import java.util.List;
public class Block {
private final List<Cell> cells;
public Block(List<Cell> cells) {
this.cells = cells;
}
public Block() {
this.cells = new ArrayList<>();
}
public List<Cell> getCells() {
return cells;
}
void addCell(Cell newCell) {
this.cells.add(newCell);
}
public boolean containsSymbol(int symbolIndex) {
for (Cell cell : getCells()) {
if (cell.getSymbolIndex() == symbolIndex)
return true;
}
return false;
}
public boolean containsCell(Cell cell) {
for (Cell cellTmp : this.cells) {
if (cellTmp.equals(cell)) {
return true;
}
}
return false;
}
}