Пример #1
0
 public bool IsBetterThanOrEqual(BoardSquareVM otherSquare)
 {
     if (this.Piece == null || otherSquare.Piece == null)
     {
         return(false);
     }
     return(this.Piece.IsBetterThanOrEqual(otherSquare.Piece));
 }
Пример #2
0
 public bool PieceEquals(BoardSquareVM otherSquare)
 {
     if (this.Piece == null || otherSquare.Piece == null)
     {
         return(false);
     }
     return(this.Piece.StartFile == otherSquare.Piece.StartFile && this.Piece.StartRank == otherSquare.Piece.StartRank);
 }
Пример #3
0
 public void AddSquare(BoardSquareVM square)
 {
     if (!_sortedSquares.ContainsKey(square.File))
     {
         _sortedSquares.Add(square.File, new Dictionary <int, BoardSquareVM>());
     }
     _sortedSquares[square.File].Add(square.Rank, square);
     this.Squares.Add(square);
 }
Пример #4
0
 public bool PieceEquals(BoardSquareVM otherSquare)
 {
     if (this.Piece == null || otherSquare.Piece == null) return false;
     return this.Piece.StartFile == otherSquare.Piece.StartFile && this.Piece.StartRank == otherSquare.Piece.StartRank;
 }
Пример #5
0
 public bool IsBetterThanOrEqual(BoardSquareVM otherSquare)
 {
     if (this.Piece == null || otherSquare.Piece == null) return false;
     return this.Piece.IsBetterThanOrEqual(otherSquare.Piece);
 }
Пример #6
0
 public void AddSquare(BoardSquareVM square)
 {
     if (!_sortedSquares.ContainsKey(square.File)) _sortedSquares.Add(square.File, new Dictionary<int, BoardSquareVM>());
     _sortedSquares[square.File].Add(square.Rank, square);
     this.Squares.Add(square);
 }
Пример #7
0
        public Move Clone()
        {
            BoardSquareVM startPosition = new BoardSquareVM(this.StartPosition.File, this.StartPosition.Rank, this.StartPosition.OriginalColor);
            if (this.StartPosition.Piece != null)
            {
                startPosition.Piece = this.StartPosition.Piece.Clone();
                startPosition.Piece.Square = startPosition;
            }

            BoardSquareVM endPosition = new BoardSquareVM(this.EndPosition.File, this.EndPosition.Rank, this.EndPosition.OriginalColor);
            if (this.EndPosition.Piece != null)
            {
                endPosition.Piece = this.EndPosition.Piece.Clone();
                endPosition.Piece.Square = endPosition;
            }

            return new Move(startPosition, endPosition);
        }
Пример #8
0
 public Move(BoardSquareVM startPosition, BoardSquareVM endPosition)
 {
     this.StartPosition = startPosition;
     this.EndPosition = endPosition;
 }