Use .Equals() override instead of manual type checks

This commit is contained in:
smoogipoo 2018-12-27 16:14:30 +09:00
parent 67e200e1b2
commit a3b6a3981c
2 changed files with 5 additions and 7 deletions

View File

@ -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();

View File

@ -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();
}
}