mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 19:04:06 +08:00
Extract Overlaps()
logic to accept generic index and length
This commit is contained in:
parent
152c7e513e
commit
30bdd2d4c0
@ -364,7 +364,9 @@ namespace osu.Game.Online.Chat
|
|||||||
Argument = argument;
|
Argument = argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Overlaps(Link otherLink) => Index < otherLink.Index + otherLink.Length && otherLink.Index < Index + Length;
|
public bool Overlaps(Link otherLink) => Overlaps(otherLink.Index, otherLink.Length);
|
||||||
|
|
||||||
|
public bool Overlaps(int index, int length) => Index < index + length && index < Index + Length;
|
||||||
|
|
||||||
public int CompareTo(Link? otherLink) => Index > otherLink?.Index ? 1 : -1;
|
public int CompareTo(Link? otherLink) => Index > otherLink?.Index ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user