osu/osu.Game/Rulesets/Mods/ModExtensions.cs
Nabile Rahmani 270e2a6600
Update osu.Game/Rulesets/Mods/ModExtensions.cs
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2023-08-29 23:59:08 +02:00

33 lines
999 B
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.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Scoring;
namespace osu.Game.Rulesets.Mods
{
public static class ModExtensions
{
public static Score CreateScoreFromReplayData(this ICreateReplayData mod, IBeatmap beatmap, IReadOnlyList<Mod> mods)
{
var replayData = mod.CreateReplayData(beatmap, mods);
return new Score
{
Replay = replayData.Replay,
ScoreInfo =
{
User = new APIUser
{
Id = replayData.User.OnlineID,
Username = replayData.User.Username,
IsBot = replayData.User.IsBot,
}
}
};
}
}
}