mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Add room settings related model and event flow
This commit is contained in:
parent
6e5846d91b
commit
baf16cfbc3
@ -27,5 +27,11 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
Task UserLeft(MultiplayerRoomUser user);
|
Task UserLeft(MultiplayerRoomUser user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Signals that the settings for this room have changed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newSettings">The updated room settings.</param>
|
||||||
|
Task SettingsChanged(MultiplayerRoomSettings newSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
|
|
||||||
public MultiplayerRoomState State { get; set; }
|
public MultiplayerRoomState State { get; set; }
|
||||||
|
|
||||||
|
public MultiplayerRoomSettings Settings { get; set; }
|
||||||
|
|
||||||
private List<MultiplayerRoomUser> users = new List<MultiplayerRoomUser>();
|
private List<MultiplayerRoomUser> users = new List<MultiplayerRoomUser>();
|
||||||
|
|
||||||
public IReadOnlyList<MultiplayerRoomUser> Users
|
public IReadOnlyList<MultiplayerRoomUser> Users
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
// 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.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.RealtimeMultiplayer
|
||||||
|
{
|
||||||
|
public class MultiplayerRoomSettings : IEquatable<MultiplayerRoomSettings>
|
||||||
|
{
|
||||||
|
public int? BeatmapID { get; set; }
|
||||||
|
|
||||||
|
public int? RulesetID { get; set; }
|
||||||
|
|
||||||
|
[NotNull]
|
||||||
|
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>();
|
||||||
|
|
||||||
|
public bool Equals(MultiplayerRoomSettings other) => BeatmapID == other?.BeatmapID && Mods.SequenceEqual(other?.Mods) && RulesetID == other?.RulesetID;
|
||||||
|
|
||||||
|
public override string ToString() => $"Beatmap:{BeatmapID} Mods:{string.Join(',', Mods)} Ruleset:{RulesetID}";
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user