@@ -1,5 +1,9 @@
|
||||
package sudoku;
|
||||
|
||||
import sudoku.constraint.IConstraint;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,8 +26,27 @@ public class Sudoku {
|
||||
return this.cells.get(index);
|
||||
}
|
||||
|
||||
public Cell getCell(int i) {
|
||||
return this.cells.get(i);
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return this.blocks.size();
|
||||
}
|
||||
|
||||
public Boolean isValid(List<IConstraint> constraints) {
|
||||
//not implemented
|
||||
//for eachcase check contraintes
|
||||
throw new Error("Function isValid() not implemented");
|
||||
}
|
||||
|
||||
public List<MutableCell> getMutableCells() {
|
||||
List<MutableCell> mutableCells = new ArrayList<>();
|
||||
for (Cell cell : this.cells) {
|
||||
if (cell instanceof MutableCell){
|
||||
mutableCells.add((MutableCell) cell);
|
||||
}
|
||||
}
|
||||
return mutableCells;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user