Beispiel #1
0
 public bool Equals(SourceCodeMapping other)
 {
     return(other != null &&
            ReferenceEquals(Mapping, other.Mapping) &&
            ILRange.Equals(other.ILRange) &&
            StartPosition.Equals(other.StartPosition) &&
            EndPosition.Equals(other.EndPosition));
 }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            if (!(obj is Move))
            {
                return(false);
            }

            var move = obj as Move;

            return(StartPosition.Equals(move.StartPosition) && EndPosition.Equals(move.EndPosition));
        }
Beispiel #3
0
 public virtual bool Equals(ChessMove other)
 {
     if (MoveType != ChessMoveType.PawnPromote)
     {
         return(other != null && StartPosition.Equals(other.StartPosition) &&
                EndPosition.Equals(other.EndPosition));
     }
     else
     {
         return(other != null && StartPosition.Equals(other.StartPosition) &&
                EndPosition.Equals(other.EndPosition) && PromotionPiece.Equals(other.PromotionPiece));
     }
 }
Beispiel #4
0
 // TODO: You must write this method.
 public virtual bool Equals(ChessMove other)
 {
     // Most chess moves are equal to each other if they have the same start and end position.
     // PawnPromote moves must also be promoting to the same piece type.
     if (MoveType == ChessMoveType.PawnPromote || other.MoveType == ChessMoveType.PawnPromote)
     {
         return(StartPosition.Equals(other.StartPosition) &&
                EndPosition.Equals(other.EndPosition) &&
                //MoveType.Equals(other.MoveType) &&
                PromoteTo.Equals(other.PromoteTo));
     }
     else
     {
         return(StartPosition.Equals(other.StartPosition) &&
                EndPosition.Equals(other.EndPosition));  //&&
                                                         //MoveType.Equals(other.MoveType));
     }
 }
 public bool Equals(ChessMove other)
 {
     return(StartPosition.Equals(other.StartPosition) && EndPosition.Equals(other.EndPosition));
 }
        public bool Equals(IGameMove m)
        {
            ChessMove other = m as ChessMove;

            return(StartPosition.Equals(other.StartPosition) && EndPosition.Equals(other.EndPosition));
        }