예제 #1
0
        SFigurePosition GetFigureCoordinates(FigureCell figure)
        {
            int x = System.Windows.Controls.Grid.GetColumn(figure);
            int y = System.Windows.Controls.Grid.GetRow(figure);

            return(new SFigurePosition(y - 1, x - 1));
        }
예제 #2
0
        private void Cell_MouseEnter(object sender, MouseEventArgs e)
        {
            FigureCell f = sender as FigureCell;

            if (f != null)
            {
                if (f.CurrentFigure != null)
                {
                    if (_desk.CanMove(GetFigureCoordinates(f)))
                    {
                        this.Cursor = Cursors.Hand;
                    }
                }
            }
        }