public Color GetCellColor(CellPoint p) { var output = Color.Transparent; if (Cells[p.Row + "," + p.Column].Fixed) { output = Cells[p.Row + "," + p.Column].Color; } else { if (FallingBlock != null && CellIsInsideBlock(p.Row, p.Column)) { var pt = BoardToBlock(p); if (FallingBlock.FilledCell(pt.Column, pt.Row)) { output = FallingBlock.Color; } } } return(output); }
public CellPoint BoardToBlock(CellPoint p) => new CellPoint(p.Row - FallingBlock.Y, p.Column - FallingBlock.X);
public CellPoint BlockToBoard(CellPoint p) => new CellPoint(p.Row + FallingBlock.Y, p.Column + FallingBlock.X);