mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Introduce StartFrame
and EndFrame
to simplify the replay interpolation code
This commit is contained in:
@ -19,27 +19,14 @@ namespace osu.Game.Rulesets.Catch.Replays
|
||||
|
||||
protected override bool IsImportant(CatchReplayFrame frame) => frame.Actions.Any();
|
||||
|
||||
protected float? Position
|
||||
{
|
||||
get
|
||||
{
|
||||
var frame = CurrentFrame;
|
||||
|
||||
if (frame == null)
|
||||
return null;
|
||||
|
||||
return NextFrame != null ? Interpolation.ValueAt(CurrentTime, frame.Position, NextFrame.Position, frame.Time, NextFrame.Time) : frame.Position;
|
||||
}
|
||||
}
|
||||
|
||||
public override void CollectPendingInputs(List<IInput> inputs)
|
||||
{
|
||||
if (!Position.HasValue) return;
|
||||
var position = Interpolation.ValueAt(CurrentTime, StartFrame.Position, EndFrame.Position, StartFrame.Time, EndFrame.Time);
|
||||
|
||||
inputs.Add(new CatchReplayState
|
||||
{
|
||||
PressedActions = CurrentFrame?.Actions ?? new List<CatchAction>(),
|
||||
CatcherX = Position.Value
|
||||
CatcherX = position
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user