mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +08:00
Allow OsuModGenerator to accept a mod list
This commit is contained in:
parent
7daeacaff2
commit
3fabe247b0
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||||
Replay = new MissingAutoGenerator(beatmap).Generate()
|
Replay = new MissingAutoGenerator(beatmap, mods).Generate()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public new OsuBeatmap Beatmap => (OsuBeatmap)base.Beatmap;
|
public new OsuBeatmap Beatmap => (OsuBeatmap)base.Beatmap;
|
||||||
|
|
||||||
public MissingAutoGenerator(IBeatmap beatmap)
|
public MissingAutoGenerator(IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(beatmap)
|
: base(beatmap, mods)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
inputManager.AllowUserCursorMovement = false;
|
inputManager.AllowUserCursorMovement = false;
|
||||||
|
|
||||||
// Generate the replay frames the cursor should follow
|
// Generate the replay frames the cursor should follow
|
||||||
replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap).Generate().Frames.Cast<OsuReplayFrame>().ToList();
|
var mods = (IReadOnlyList<Mod>)drawableRuleset.Dependencies.Get(typeof(IReadOnlyList<Mod>));
|
||||||
|
replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap, mods).Generate().Frames.Cast<OsuReplayFrame>().ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||||
Replay = new OsuAutoGenerator(beatmap).Generate()
|
Replay = new OsuAutoGenerator(beatmap, mods).Generate()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||||
Replay = new OsuAutoGenerator(beatmap).Generate()
|
Replay = new OsuAutoGenerator(beatmap, mods).Generate()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,12 @@ using osu.Framework.Utils;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Scoring;
|
using osu.Game.Rulesets.Osu.Scoring;
|
||||||
@ -49,8 +51,8 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
|
|
||||||
#region Construction / Initialisation
|
#region Construction / Initialisation
|
||||||
|
|
||||||
public OsuAutoGenerator(IBeatmap beatmap)
|
public OsuAutoGenerator(IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(beatmap)
|
: base(beatmap, mods)
|
||||||
{
|
{
|
||||||
// Already superhuman, but still somewhat realistic
|
// Already superhuman, but still somewhat realistic
|
||||||
reactionTime = ApplyModsToRate(100);
|
reactionTime = ApplyModsToRate(100);
|
||||||
|
@ -6,6 +6,7 @@ using osu.Game.Beatmaps;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
protected Replay Replay;
|
protected Replay Replay;
|
||||||
protected List<ReplayFrame> Frames => Replay.Frames;
|
protected List<ReplayFrame> Frames => Replay.Frames;
|
||||||
|
|
||||||
protected OsuAutoGeneratorBase(IBeatmap beatmap)
|
protected OsuAutoGeneratorBase(IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
Replay = new Replay();
|
Replay = new Replay();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user