mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Use .Equals() override instead of manual type checks
This commit is contained in:
parent
67e200e1b2
commit
a3b6a3981c
@ -88,14 +88,9 @@ namespace osu.Game.Online.Multiplayer
|
||||
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
|
||||
Host.Value = other.Host;
|
||||
|
||||
if (Status.Value.GetType() != other.Status.Value.GetType())
|
||||
Status.Value = other.Status;
|
||||
|
||||
Status.Value = other.Status;
|
||||
Availability.Value = other.Availability;
|
||||
|
||||
if (Type.Value.GetType() != other.Type.Value.GetType())
|
||||
Type.Value = other.Type;
|
||||
|
||||
Type.Value = other.Type;
|
||||
MaxParticipants.Value = other.MaxParticipants;
|
||||
ParticipantCount.Value = other.ParticipantCount.Value;
|
||||
Participants.Value = other.Participants.Value.ToArray();
|
||||
|
@ -10,5 +10,8 @@ namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
public abstract string Message { get; }
|
||||
public abstract Color4 GetAppropriateColour(OsuColour colours);
|
||||
|
||||
public override int GetHashCode() => GetType().GetHashCode();
|
||||
public override bool Equals(object obj) => GetType() == obj?.GetType();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user