ANGLICHE
All checks were successful
Linux arm64 / Build (push) Successful in 34s

This commit is contained in:
2025-01-10 16:14:52 +01:00
parent 77c0b0d41b
commit 8cd0f6fa12
8 changed files with 68 additions and 74 deletions

View File

@@ -0,0 +1,47 @@
package sudoku;
public class Cell {
private static int NOSYMBOLE = -1;
private int symboleIndex;
private Block block = null;
public Cell(int symboleIndex) {
this.symboleIndex = symboleIndex;
}
/**
* @brief Default constructor, empty square
*/
public Cell() {
this(NOSYMBOLE);
}
public int getSymboleIndex() {
return symboleIndex;
}
public void setSymboleIndex(int symboleIndex) {
this.symboleIndex = symboleIndex;
}
public void clear() {
setSymboleIndex(NOSYMBOLE);
}
public Block getBlock() {
return this.block;
}
// only SudokuFactory should access this
void setBlock(Block block) {
this.block = block;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Cell otherCell)
return otherCell.getSymboleIndex() == this.getSymboleIndex();
return false;
}
}