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