mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:53:00 +08: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)
|
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
|
||||||
Host.Value = other.Host;
|
Host.Value = other.Host;
|
||||||
|
|
||||||
if (Status.Value.GetType() != other.Status.Value.GetType())
|
Status.Value = other.Status;
|
||||||
Status.Value = other.Status;
|
|
||||||
|
|
||||||
Availability.Value = other.Availability;
|
Availability.Value = other.Availability;
|
||||||
|
Type.Value = other.Type;
|
||||||
if (Type.Value.GetType() != other.Type.Value.GetType())
|
|
||||||
Type.Value = other.Type;
|
|
||||||
|
|
||||||
MaxParticipants.Value = other.MaxParticipants;
|
MaxParticipants.Value = other.MaxParticipants;
|
||||||
ParticipantCount.Value = other.ParticipantCount.Value;
|
ParticipantCount.Value = other.ParticipantCount.Value;
|
||||||
Participants.Value = other.Participants.Value.ToArray();
|
Participants.Value = other.Participants.Value.ToArray();
|
||||||
|
@ -10,5 +10,8 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
{
|
{
|
||||||
public abstract string Message { get; }
|
public abstract string Message { get; }
|
||||||
public abstract Color4 GetAppropriateColour(OsuColour colours);
|
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