mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
equatable FormattedMessage (#5772)
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Robust.Shared.Utility;
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class FormattedMessage : IReadOnlyList<MarkupNode>
|
||||
public sealed partial class FormattedMessage : IEquatable<FormattedMessage>, IReadOnlyList<MarkupNode>
|
||||
{
|
||||
public static FormattedMessage Empty => new();
|
||||
|
||||
@@ -278,6 +278,18 @@ public sealed partial class FormattedMessage : IReadOnlyList<MarkupNode>
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(FormattedMessage? other)
|
||||
{
|
||||
return other?.ToMarkup() == ToMarkup();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ToMarkup().GetHashCode();
|
||||
}
|
||||
|
||||
/// <returns>The string without markup tags.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user