mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Implement a conversion process for ReplayFrames
This commit is contained in:
@ -1,17 +1,31 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Replays
|
||||
{
|
||||
public class CatchReplayFrame : ReplayFrame
|
||||
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
|
||||
{
|
||||
public override bool IsImportant => MouseX > 0;
|
||||
public float X;
|
||||
public bool Dashing;
|
||||
|
||||
public CatchReplayFrame(double time, float? x = null, ReplayButtonState button = ReplayButtonState.None)
|
||||
: base(time, x ?? -1, null, button)
|
||||
public CatchReplayFrame(double time, float? x = null, bool dashing = false)
|
||||
: base(time)
|
||||
{
|
||||
X = x ?? -1;
|
||||
Dashing = dashing;
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap)
|
||||
{
|
||||
// Todo: This needs to be re-scaled
|
||||
X = legacyFrame.Position.X;
|
||||
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user