示例#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
文件: BoardVM.cs 项目: Puddler/Chess
 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
文件: BoardVM.cs 项目: Puddler/Chess
 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
文件: Move.cs 项目: Puddler/Chess
        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
文件: Move.cs 项目: Puddler/Chess
 public Move(BoardSquareVM startPosition, BoardSquareVM endPosition)
 {
     this.StartPosition = startPosition;
     this.EndPosition = endPosition;
 }