This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package sudoku;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public abstract class Cell {
|
||||
|
||||
protected static int NOSYMBOLE = -1;
|
||||
@JsonProperty("symboleIndex")
|
||||
protected int symboleIndex;
|
||||
protected Block block = null;
|
||||
|
||||
@@ -25,15 +28,15 @@ public abstract class Cell {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
// only SudokuFactory should access this
|
||||
void setBlock(Block block) {
|
||||
// only SudokuFactory and SudokuSerializer should access this
|
||||
public 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;
|
||||
}
|
||||
// @Override
|
||||
// public boolean equals(Object obj) {
|
||||
// if (obj instanceof Cell otherCell)
|
||||
// return otherCell.getSymboleIndex() == this.getSymboleIndex();
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user