示例#1
0
        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);
        }
示例#2
0
 public CellPoint BoardToBlock(CellPoint p) => new CellPoint(p.Row - FallingBlock.Y, p.Column - FallingBlock.X);
示例#3
0
 public CellPoint BlockToBoard(CellPoint p) => new CellPoint(p.Row + FallingBlock.Y, p.Column + FallingBlock.X);