1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 07:52:57 +08:00

Decrease redundancy of equality implementations

This commit is contained in:
Bartłomiej Dach 2023-11-20 12:28:20 +09:00
parent 25c1a90047
commit 7820c8ce4d
No known key found for this signature in database

View File

@ -74,15 +74,12 @@ namespace osu.Game.Rulesets.Objects.Types
=> HashCode.Combine(Type, Degree);
public override bool Equals(object? obj)
=> obj is PathType pathType && this == pathType;
public static bool operator ==(PathType a, PathType b)
=> a.Type == b.Type && a.Degree == b.Degree;
public static bool operator !=(PathType a, PathType b)
=> a.Type != b.Type || a.Degree != b.Degree;
=> obj is PathType pathType && Equals(pathType);
public bool Equals(PathType other)
=> Type == other.Type && Degree == other.Degree;
public static bool operator ==(PathType a, PathType b) => a.Equals(b);
public static bool operator !=(PathType a, PathType b) => !a.Equals(b);
}
}