// Copyright (c) ppy Pty Ltd . 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.Replays; using osu.Game.Scoring; using osu.Game.Users; namespace osu.Game.Rulesets.Mods { /// /// A mod which creates full replay data, which is to be played back in place of a local user playing the game. /// public interface ICreateReplayData { /// /// Create replay data. /// /// The beatmap to create replay data for. /// The mods to take into account when creating the replay data. /// A structure, containing the generated replay data. /// /// For callers that want to receive a directly usable instance, /// the extension method is provided for convenience. /// ModReplayData CreateReplayData(IBeatmap beatmap, IReadOnlyList mods); } /// /// Data created by a mod that implements . /// public class ModReplayData { /// /// The full replay data. /// public readonly Replay Replay; /// /// Placeholder user data to show in place of the local user when the associated mod is active. /// public readonly ModCreatedUser User; public ModReplayData(Replay replay, ModCreatedUser? user = null) { Replay = replay; User = user ?? new ModCreatedUser(); } } /// /// A user which is associated with a replay that was created by a mod (ie. autoplay or cinema). /// public class ModCreatedUser : IUser { public int OnlineID => APIUser.SYSTEM_USER_ID; public CountryCode CountryCode => default; public bool IsBot => true; public string Username { get; set; } = string.Empty; } }