コード例 #1
0
        public void Replace(ChessLogic.Point from, ChessLogic.Point to)
        {
            var lab = FindFigure(from);

            lab.SetValue(Canvas.LeftProperty, to.x * cellWidth);
            lab.SetValue(Canvas.TopProperty, to.y * cellHeight);
            sp.Play();
        }
コード例 #2
0
 public void SelectFigure(ChessLogic.Point cell)
 {
     if (board.IsCanToSelect(cell))
     {
         selected = new ChessLogic.Point(cell.x, cell.y);
         var img = FindFigure(selected);
         img.Background.Opacity = 0.5d;
         isSelected             = true;
     }
 }
コード例 #3
0
 private Border FindFigure(ChessLogic.Point point)
 {
     foreach (var img in figures)
     {
         if (GetIndex(img) == point)
         {
             return(img);
         }
     }
     throw new Exception("Error 404: Figure not found");
 }
コード例 #4
0
 public void MoveRequest(ChessLogic.Point from, ChessLogic.Point to)
 {
     board.MoveRequest(from, to);
 }
コード例 #5
0
 public void DeleteCellContent(ChessLogic.Point cell)
 {
     canvas.Children.Remove(FindFigure(cell));
     figures.Remove(FindFigure(cell));
 }
コード例 #6
0
 public void Set(ChessLogic.Point cell, Figures figure)
 {
     CreateFigure(cell.x, cell.y, figure, Fileworker.GetStyle());
 }