Ejemplo n.º 1
0
        public static PieceView FromPath(string path)
        {
            PieceView pieceView = new PieceView();

            pieceView.SetImagePath(path);
            return(pieceView);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates a square with a piece view representation
        /// </summary>
        /// <param name="square">Square model</param>
        /// <param name="viewIndex">index in boardsquares view</param>
        private void UpdateSquarePiece(Square square, int viewIndex)
        {
            Piece     piece     = square.Piece;
            string    imgPath   = GetImagePathFromPiece(piece);
            PieceView pieceView = PieceView.FromPath(imgPath);

            BoardView.Squares[viewIndex].SetPieceView(pieceView);
        }
Ejemplo n.º 3
0
        public SquareView()
        {
            Background      = Brushes.White;
            PieceView       = new PieceView();
            BorderBrush     = Brushes.Black;
            BorderThickness = new Thickness(3);

            // default color, but should never be visible unless something didn't setup correctly
            SquareColor = Brushes.Magenta;
        }
Ejemplo n.º 4
0
 public void SetPieceView(PieceView pieceView)
 {
     Content = pieceView;
 }