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