public bool Equals(SourceCodeMapping other) { return(other != null && ReferenceEquals(Mapping, other.Mapping) && ILRange.Equals(other.ILRange) && StartPosition.Equals(other.StartPosition) && EndPosition.Equals(other.EndPosition)); }
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)); }
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)); } }
// 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)); }