mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 20:50:41 +08:00
Rename to GameplayItem + adjust documentation
This commit is contained in:
@@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual.Matchmaking
|
||||
|
||||
state.CandidateItems = beatmaps.Select(b => b.ID).ToArray();
|
||||
state.CandidateItem = beatmaps[0].ID;
|
||||
state.FinalItem = beatmaps[0].ID;
|
||||
state.GameplayItem = beatmaps[0].ID;
|
||||
}, waitTime: 35);
|
||||
|
||||
changeStage(MatchmakingStage.WaitingForClientsBeatmapDownload);
|
||||
|
||||
@@ -28,14 +28,20 @@ namespace osu.Game.Online.Multiplayer.MatchTypes.Matchmaking
|
||||
public int CurrentRound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The playlist items that were picked as gameplay candidates.
|
||||
/// The playlist items that were picked as candidates by user.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// May contain <c>-1</c> when any users picked the "random" playlist item.
|
||||
/// </remarks>
|
||||
[Key(2)]
|
||||
public long[] CandidateItems { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The final gameplay candidate.
|
||||
/// A playlist item from <see cref="CandidateItems"/> that was randomly picked by the server.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// May be <c>-1</c> to indicate the "random" playlist item was chosen.
|
||||
/// </remarks>
|
||||
[Key(3)]
|
||||
public long CandidateItem { get; set; }
|
||||
|
||||
@@ -45,8 +51,14 @@ namespace osu.Game.Online.Multiplayer.MatchTypes.Matchmaking
|
||||
[Key(4)]
|
||||
public MatchmakingUserList Users { get; set; } = new MatchmakingUserList();
|
||||
|
||||
/// <summary>
|
||||
/// A playlist item from the room's playlist that will be played in the current round.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The value of this property may not equal <see cref="CandidateItem"/> or exist in <see cref="CandidateItems"/>.
|
||||
/// </remarks>
|
||||
[Key(5)]
|
||||
public long FinalItem { get; set; }
|
||||
public long GameplayItem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Advances to the next round.
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect
|
||||
panel.RemoveUser(user);
|
||||
});
|
||||
|
||||
public void RollAndDisplayFinalBeatmap(long[] candidateItemIds, long candidateItemId, long finalItemId) => whenPanelsLoaded(() =>
|
||||
public void RollAndDisplayFinalBeatmap(long[] candidateItemIds, long candidateItemId, long gameplayItemId) => whenPanelsLoaded(() =>
|
||||
{
|
||||
Debug.Assert(candidateItemIds.Length >= 1);
|
||||
Debug.Assert(candidateItemIds.Contains(candidateItemId));
|
||||
@@ -156,16 +156,16 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect
|
||||
this.Delay(ARRANGE_DELAY)
|
||||
.Schedule(() => ArrangeItemsForRollAnimation())
|
||||
.Delay(arrange_duration + present_beatmap_delay)
|
||||
.Schedule(() => PresentUnanimouslyChosenBeatmap(candidateItemId, finalItemId));
|
||||
.Schedule(() => PresentUnanimouslyChosenBeatmap(candidateItemId, gameplayItemId));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Delay(ARRANGE_DELAY)
|
||||
.Schedule(() => ArrangeItemsForRollAnimation())
|
||||
.Delay(arrange_duration)
|
||||
.Schedule(() => PlayRollAnimation(finalItemId, roll_duration))
|
||||
.Schedule(() => PlayRollAnimation(gameplayItemId, roll_duration))
|
||||
.Delay(roll_duration + present_beatmap_delay)
|
||||
.Schedule(() => PresentRolledBeatmap(candidateItemId, finalItemId));
|
||||
.Schedule(() => PresentRolledBeatmap(candidateItemId, gameplayItemId));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -312,10 +312,10 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect
|
||||
}
|
||||
}
|
||||
|
||||
internal void PresentRolledBeatmap(long candidateItem, long finalItem)
|
||||
internal void PresentRolledBeatmap(long candidateItem, long gameplayItem)
|
||||
{
|
||||
Debug.Assert(rollContainer.Children.Any(it => it.Item.ID == candidateItem));
|
||||
Debug.Assert(playlistItems.ContainsKey(finalItem));
|
||||
Debug.Assert(playlistItems.ContainsKey(gameplayItem));
|
||||
|
||||
foreach (var panel in rollContainer.Children)
|
||||
{
|
||||
@@ -331,18 +331,18 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect
|
||||
{
|
||||
rollContainer.ChangeChildDepth(panel, float.MinValue);
|
||||
|
||||
var item = playlistItems[finalItem];
|
||||
var item = playlistItems[gameplayItem];
|
||||
|
||||
panel.PresentAsChosenBeatmap(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
internal void PresentUnanimouslyChosenBeatmap(long candidateItem, long finalItem)
|
||||
internal void PresentUnanimouslyChosenBeatmap(long candidateItem, long gameplayItem)
|
||||
{
|
||||
// TODO: display special animation in this case
|
||||
|
||||
PresentRolledBeatmap(candidateItem, finalItem);
|
||||
PresentRolledBeatmap(candidateItem, gameplayItem);
|
||||
}
|
||||
|
||||
private readonly TaskCompletionSource panelsLoaded = new TaskCompletionSource();
|
||||
|
||||
+2
-2
@@ -134,8 +134,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect
|
||||
beatmapSelectGrid.SetUserSelection(user, itemId, false);
|
||||
}
|
||||
|
||||
public void RollFinalBeatmap(long[] candidateItems, long candidateItem, long finalItem) =>
|
||||
beatmapSelectGrid.RollAndDisplayFinalBeatmap(candidateItems, candidateItem, finalItem);
|
||||
public void RollFinalBeatmap(long[] candidateItems, long candidateItem, long gameplayItem) =>
|
||||
beatmapSelectGrid.RollAndDisplayFinalBeatmap(candidateItems, candidateItem, gameplayItem);
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
|
||||
|
||||
case MatchmakingStage.ServerBeatmapFinalised:
|
||||
Debug.Assert(screenStack.CurrentScreen is SubScreenBeatmapSelect);
|
||||
((SubScreenBeatmapSelect)screenStack.CurrentScreen).RollFinalBeatmap(matchmakingState.CandidateItems, matchmakingState.CandidateItem, matchmakingState.FinalItem);
|
||||
((SubScreenBeatmapSelect)screenStack.CurrentScreen).RollFinalBeatmap(matchmakingState.CandidateItems, matchmakingState.CandidateItem, matchmakingState.GameplayItem);
|
||||
break;
|
||||
|
||||
case MatchmakingStage.ResultsDisplaying:
|
||||
|
||||
Reference in New Issue
Block a user