1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 09:09:52 +08:00
Files
osu-lazer/osu.Game/Online/Matchmaking/MatchmakingPool.cs
T
Dan Balasescu a3b8b9aee9 Implement duels for ranked play (#37556)
I've seen this suggested quite a bit and is a pretty easy implementation
all things considered.

For now, while on the queue screen, you can open up the dashboard
overlay and select another player to duel. This will bring you into an
unranked lobby.


https://github.com/user-attachments/assets/712897a9-9350-4741-899d-59662c722e43
2026-04-29 16:12:27 +09:00

68 lines
1.8 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics.CodeAnalysis;
using MessagePack;
namespace osu.Game.Online.Matchmaking
{
[MessagePackObject]
[Serializable]
public class MatchmakingPool : IEquatable<MatchmakingPool>
{
[Key(0)]
public int Id { get; set; }
[Key(1)]
public int RulesetId { get; set; }
[Key(2)]
public int Variant { get; set; }
[Key(3)]
public string Name { get; set; } = string.Empty;
[Key(4)]
public MatchmakingPoolType Type { get; set; } = MatchmakingPoolType.QuickPlay;
[IgnoreMember]
public string DisplayName
{
get
{
switch (RulesetId)
{
case 0:
return $"osu! ({Name})";
case 1:
return $"osu!taiko ({Name})";
case 2:
return $"osu!catch ({Name})";
case 3:
return $"osu!mania {Variant}K ({Name})";
default:
return Name;
}
}
}
public bool Equals(MatchmakingPool? other)
=> other != null
&& Id == other.Id
&& RulesetId == other.RulesetId
&& Variant == other.Variant
&& Name == other.Name;
public override bool Equals(object? obj)
=> obj is MatchmakingPool other && Equals(other);
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
public override int GetHashCode() => HashCode.Combine(Id, RulesetId, Variant, Name);
}
}