Rename catch frame's X to Position

This commit is contained in:
smoogipoo
2018-03-01 01:48:13 +09:00
parent 195b6642e6
commit a24e8b02e8
2 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Replays
{ {
} }
protected override bool IsImportant(CatchReplayFrame frame) => frame.X > 0; protected override bool IsImportant(CatchReplayFrame frame) => frame.Position > 0;
protected float? Position protected float? Position
{ {
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Catch.Replays
if (!HasFrames) if (!HasFrames)
return null; return null;
return Interpolation.ValueAt(CurrentTime, CurrentFrame.X, NextFrame.X, CurrentFrame.Time, NextFrame.Time); return Interpolation.ValueAt(CurrentTime, CurrentFrame.Position, NextFrame.Position, CurrentFrame.Time, NextFrame.Time);
} }
} }
@ -37,9 +37,9 @@ namespace osu.Game.Rulesets.Catch.Replays
if (CurrentFrame.Dashing) if (CurrentFrame.Dashing)
actions.Add(CatchAction.Dash); actions.Add(CatchAction.Dash);
if (Position.Value > CurrentFrame.X) if (Position.Value > CurrentFrame.Position)
actions.Add(CatchAction.MoveRight); actions.Add(CatchAction.MoveRight);
else if (Position.Value < CurrentFrame.X) else if (Position.Value < CurrentFrame.Position)
actions.Add(CatchAction.MoveLeft); actions.Add(CatchAction.MoveLeft);
return new List<InputState> return new List<InputState>

View File

@ -10,24 +10,24 @@ namespace osu.Game.Rulesets.Catch.Replays
{ {
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
{ {
public float X; public float Position;
public bool Dashing; public bool Dashing;
public CatchReplayFrame() public CatchReplayFrame()
{ {
} }
public CatchReplayFrame(double time, float? x = null, bool dashing = false) public CatchReplayFrame(double time, float? position = null, bool dashing = false)
: base(time) : base(time)
{ {
X = x ?? -1; Position = position ?? -1;
Dashing = dashing; Dashing = dashing;
} }
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap) public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
{ {
// Todo: This needs to be re-scaled // Todo: This needs to be re-scaled
X = legacyFrame.Position.X; Position = legacyFrame.Position.X;
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1; Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
} }
} }