Files
Sudoku/app/src/main/java/sudoku/MutableCell.java
Janet-Doe e5618b70c1
All checks were successful
Linux arm64 / Build (push) Successful in 33s
refractoring
2025-01-21 13:49:22 +01:00

43 lines
828 B
Java

package sudoku;
import java.util.ArrayList;
import java.util.List;
public class MutableCell extends Cell{
private final List<Integer> possibleSymbols;
public MutableCell() {
super();
this.possibleSymbols = new ArrayList<>();
}
public MutableCell(int symbolIndex) {
super(symbolIndex);
this.possibleSymbols = new ArrayList<>();
}
public void setSymbolIndex(int symbolIndex) {
this.symbolIndex = symbolIndex;
}
/**
* Remove the current symbolIndex and returns it
* @return integer symbolIndex cleared
*/
public int clearCurrentSymbol() {
int i = this.symbolIndex;
setSymbolIndex(NOSYMBOLE);
return i;
}
public void removeSymbolFromPossibilities(int indexSymbol) {
possibleSymbols.remove(indexSymbol);
}
public List<Integer> getPossibleSymbols() {
return this.possibleSymbols;
}
}