private void ChangeColor(ColorState color, int i, int j, int di, int dj) { i += di; j += dj; while (fields[i, j].ToColor() != color) { fields[i, j] = color.ToFieldState(); i += di; j += dj; } }
internal int CalcPieces(ColorState color) { FieldState pieceColor = color.ToFieldState(); int pieces = 0; foreach (var f in fields) { if (f == pieceColor) { pieces++; } } return(pieces); }