Files
Sudoku/app/src/main/java/sudoku/MutableCell.java
Persson-dev 3a69139798
All checks were successful
Linux arm64 / Build (push) Successful in 52s
fix build
2025-01-21 19:28:53 +01:00

48 lines
976 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;
}
public void setPossibleSymbols(List<Integer> possibleSymbols) {
this.possibleSymbols.clear();
this.possibleSymbols.addAll(possibleSymbols);
}
/**
* Remove the current symbolIndex and returns it
* @return integer symbolIndex cleared
*/
public int clearCurrentSymbol() {
int i = this.symbolIndex;
setSymbolIndex(NOSYMBOL);
return i;
}
public void removeSymbolFromPossibilities(int indexSymbol) {
possibleSymbols.remove(indexSymbol);
}
public List<Integer> getPossibleSymbols() {
return this.possibleSymbols;
}
}