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:
parent
25c1a90047
commit
7820c8ce4d
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user