public int DestroyLines()
{
// Find total lines
int BlockLineCount = 0;
for (int j = 0; j < height; j++)
{
for (int i = 0; i < width; i++)
if (boardFields[i, j] == FieldState.Static)
BlockLine = true;
else
{
BlockLine = false;
break;
}
//Destroy total lines
if (BlockLine)
{
// Save number of total lines
BlockLineCount++;
for (int l = j; l > 0; l--)
for (int k = 0; k < width; k++)
{
boardFields[k, l] = boardFields[k, l - 1];
BoardColor[k, l] = BoardColor[k, l - 1];
}
for (int l = 0; l < width; l++)
{
boardFields[l, 0] = FieldState.Free;
BoardColor[l, 0] = -1;
}
}
}
return BlockLineCount;
}