public bool IsBetterThanOrEqual(BoardSquareVM otherSquare) { if (this.Piece == null || otherSquare.Piece == null) { return(false); } return(this.Piece.IsBetterThanOrEqual(otherSquare.Piece)); }
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); }
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); }
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; }
public bool IsBetterThanOrEqual(BoardSquareVM otherSquare) { if (this.Piece == null || otherSquare.Piece == null) return false; return this.Piece.IsBetterThanOrEqual(otherSquare.Piece); }
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); }
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); }
public Move(BoardSquareVM startPosition, BoardSquareVM endPosition) { this.StartPosition = startPosition; this.EndPosition = endPosition; }