Beispiel #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();
        }
Beispiel #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;
     }
 }
Beispiel #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");
 }
Beispiel #4
0
 public void MoveRequest(ChessLogic.Point from, ChessLogic.Point to)
 {
     board.MoveRequest(from, to);
 }
Beispiel #5
0
 public void DeleteCellContent(ChessLogic.Point cell)
 {
     canvas.Children.Remove(FindFigure(cell));
     figures.Remove(FindFigure(cell));
 }
Beispiel #6
0
 public void Set(ChessLogic.Point cell, Figures figure)
 {
     CreateFigure(cell.x, cell.y, figure, Fileworker.GetStyle());
 }