private bool SprawdzPoziomo(int x, int y) { if (Tablica[x][y] == OBIEKT.puste) { return(false); } OBIEKT typ = Tablica[x][y]; int count = 1; for (int i = x + 1; i < X; i++) { if (Tablica[i][y] != typ) { break; } count++; } return(count >= 3); }
private bool SprawdzUkos(int x, int y) { if (Tablica[x][y] == OBIEKT.puste) { return(false); } OBIEKT typ = Tablica[x][y]; int count = 1; for (int i = x + 1, j = y + 1; i < X && j < Y;) { if (Tablica[i][j] != typ) { break; } count++; j++; i++; } if (count >= 3) { return(true); } count = 1; for (int i = x - 1, j = y + 1; i >= 0 && j < Y;) { if (Tablica[i][j] != typ) { break; } count++; j++; i--; } return(count >= 3); }
public bool Zaznacz(OBIEKT obj, int x, int y) { Tablica[y][x] = obj; return(true); }