кто нибудь может объяснить почему валидатор выдает ошибку о том что я считаю соседей для мины ячейки?
package com.javarush.games.minesweeper;
import com.javarush.engine.cell.*;
import java.util.ArrayList;
import java.util.List;
public class MinesweeperGame extends Game {
private static final int SIDE = 9;
private GameObject[][] gameField = new GameObject[SIDE][SIDE];
private int countMinesOnField;
public void initialize(){
setScreenSize(SIDE, SIDE);
createGame();
}
private void createGame(){
boolean isMine = false;
int values = 0;
for (int i = 0; i<SIDE; i++){
for (int j = 0; j<SIDE; j++){
if(getRandomNumber(10) == 0){
isMine = true;
}
gameField[j][i] = new GameObject(i,j, isMine);
if(isMine){
values++;
}
}
}
countMinesOnField = values;
}
private int getNeighbors(GameObject gameObject){
List<GameObject> result = new ArrayList<>();
int size = 0;
for(int i = gameObject.x-1; i <= gameObject.x+1; i++){
for(int j = gameObject.y-1; j <= gameObject.y+1; j++){
if(i < 0 || i > SIDE) continue;
if(j < 0 || j > SIDE) continue;
if(gameField[j][i] == gameObject) continue;
result.add(gameField[j][i]);
}
}
return size;
}
private void countMineNeighbors(){
for(int x = 0; x<SIDE; x++){
for(int y = 0; y<SIDE; y++){
if(!gameField[y][x].isMine){
gameField[y][x].countMineNeighbors = getNeighbors(gameField[y][x]);
}
}
}
}
}