1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00
osu-lazer/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs

35 lines
1.0 KiB
C#
Raw Normal View History

2018-01-12 17:35:28 +08:00
// 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.Catch.UI;
2018-01-12 17:35:28 +08:00
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Replays.Legacy;
using osu.Game.Rulesets.Replays.Types;
2018-01-12 17:35:28 +08:00
namespace osu.Game.Rulesets.Catch.Replays
{
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
2018-01-12 17:35:28 +08:00
{
2018-03-01 00:48:13 +08:00
public float Position;
public bool Dashing;
2018-01-12 17:35:28 +08:00
public CatchReplayFrame()
{
}
2018-03-01 00:48:13 +08:00
public CatchReplayFrame(double time, float? position = null, bool dashing = false)
: base(time)
2018-01-12 17:35:28 +08:00
{
2018-03-01 00:48:13 +08:00
Position = position ?? -1;
Dashing = dashing;
}
2018-03-01 00:38:40 +08:00
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
{
Position = legacyFrame.Position.X / CatchPlayfield.BASE_WIDTH;
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
2018-01-12 17:35:28 +08:00
}
}
}