Add new, more robust Breakpoint struct

This commit is contained in:
Yoshi Askharoun
2023-05-23 20:28:19 -05:00
parent a7fea61af6
commit 1b26ce4d5f
3 changed files with 32 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
using System;
namespace Microsoft.Iris.Debug;
public struct Breakpoint : IEquatable<Breakpoint>
{
public Breakpoint(string uri, int line, int column)
{
Uri = uri;
Line = line;
Column = column;
}
public string Uri { get; set; }
public int Line { get; set; }
public int Column { get; set; }
public bool Equals(string uri, int line, int column) => uri == Uri && line == Line && column == Column;
public bool Equals(Breakpoint other) => Equals(other.Uri, other.Line, other.Column);
public static bool operator ==(Breakpoint left, Breakpoint right) => left.Equals(right);
public static bool operator !=(Breakpoint left, Breakpoint right) => !(left == right);
public override bool Equals(object obj) => obj is Breakpoint bp && Equals(bp);
}