Add osu! autoplay generation.

Doesn't work on complex sliders yet.
This commit is contained in:
Dean Herbert
2017-03-05 17:46:00 +09:00
parent 7afcac3660
commit 1c5b918f9e
8 changed files with 349 additions and 14 deletions

View File

@ -17,7 +17,12 @@ namespace osu.Game.Modes
{
public class LegacyReplay : Replay
{
private List<LegacyReplayFrame> frames = new List<LegacyReplayFrame>();
protected List<LegacyReplayFrame> Frames = new List<LegacyReplayFrame>();
protected LegacyReplay()
{
}
public LegacyReplay(StreamReader reader)
{
@ -31,7 +36,7 @@ namespace osu.Game.Modes
lastTime += float.Parse(split[0]);
frames.Add(new LegacyReplayFrame(
Frames.Add(new LegacyReplayFrame(
lastTime,
float.Parse(split[1]),
384 - float.Parse(split[2]),
@ -40,7 +45,7 @@ namespace osu.Game.Modes
}
}
public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(frames);
public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames);
/// <summary>
/// The ReplayHandler will take a replay and handle the propagation of updates to the input stack.

View File

@ -43,6 +43,8 @@ namespace osu.Game.Modes
public virtual FontAwesome Icon => FontAwesome.fa_question_circle;
public virtual Score CreateAutoplayReplay(Beatmap beatmap) => null;
public static Ruleset GetRuleset(PlayMode mode)
{
Type type;
@ -52,5 +54,6 @@ namespace osu.Game.Modes
return Activator.CreateInstance(type) as Ruleset;
}
}
}