public bool Collision(Tetrominoe figure) { if (this.CurrentFigureCol > this.TetrisColumns - figure.Height) { return(true); } if (this.CurrentFigureRow + figure.Width == this.TetrisRows) { return(true); } for (int row = 0; row < figure.Width; row++) { for (int col = 0; col < figure.Height; col++) { if (figure.Body[row, col] && this.TetrisField[this.CurrentFigureRow + row + 1, this.CurrentFigureCol + col]) { return(true); } } } return(false); }
public void DrawCurrentFigure(Tetrominoe currentFigure, int currentFigureRow, int currentFigureColumn) { for (int row = 0; row < currentFigure.Width; row++) { for (int col = 0; col < currentFigure.Height; col++) { if (currentFigure.Body[row, col]) { Write(this.tetrisCharacter.ToString(), row + 1 + currentFigureRow, 1 + currentFigureColumn + col); } } } }