mirror of
https://github.com/osukey/osukey.git
synced 2025-05-12 00:57:21 +09:00
Small improvements to testable room manager
This commit is contained in:
parent
9b0ca8fc3b
commit
7d1fe7955e
@ -5,11 +5,13 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
using osu.Game.Screens.Multi.RealtimeMultiplayer;
|
using osu.Game.Screens.Multi.RealtimeMultiplayer;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
||||||
@ -22,6 +24,9 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuGameBase game { get; set; }
|
private OsuGameBase game { get; set; }
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
public readonly Bindable<FilterCriteria> Filter = new Bindable<FilterCriteria>(new FilterCriteria());
|
||||||
|
|
||||||
private readonly List<Room> rooms = new List<Room>();
|
private readonly List<Room> rooms = new List<Room>();
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -29,6 +34,7 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
int currentScoreId = 0;
|
int currentScoreId = 0;
|
||||||
|
int currentRoomId = 0;
|
||||||
|
|
||||||
((DummyAPIAccess)api).HandleRequest = req =>
|
((DummyAPIAccess)api).HandleRequest = req =>
|
||||||
{
|
{
|
||||||
@ -38,7 +44,7 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
|||||||
var createdRoom = new APICreatedRoom();
|
var createdRoom = new APICreatedRoom();
|
||||||
|
|
||||||
createdRoom.CopyFrom(createRoomRequest.Room);
|
createdRoom.CopyFrom(createRoomRequest.Room);
|
||||||
createdRoom.RoomID.Value = 1;
|
createdRoom.RoomID.Value ??= currentRoomId++;
|
||||||
|
|
||||||
rooms.Add(createdRoom);
|
rooms.Add(createdRoom);
|
||||||
createRoomRequest.TriggerSuccess(createdRoom);
|
createRoomRequest.TriggerSuccess(createdRoom);
|
||||||
@ -103,6 +109,8 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public new void ClearRooms() => base.ClearRooms();
|
||||||
|
|
||||||
public new void Schedule(Action action) => base.Schedule(action);
|
public new void Schedule(Action action) => base.Schedule(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user