An attempt at implementing storyboard loops.

This commit is contained in:
Damnae
2017-09-08 12:11:57 +02:00
parent 13322b4293
commit e02b481c69
7 changed files with 71 additions and 54 deletions

View File

@ -2,26 +2,28 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
namespace osu.Game.Storyboards
{
public class CommandLoop : CommandTimelineGroup
{
private double startTime;
private int loopCount;
public double LoopStartTime;
public int LoopCount;
public CommandLoop(double startTime, int loopCount)
{
this.startTime = startTime;
this.loopCount = loopCount;
LoopStartTime = startTime;
LoopCount = loopCount;
}
public override void ApplyTransforms(Drawable drawable)
{
//base.ApplyTransforms(drawable);
}
public override void ApplyTransforms(Drawable drawable, double offset = 0)
=> base.ApplyTransforms(drawable, offset + LoopStartTime);
protected override void PostProcess(Command command, TransformSequence<Drawable> sequence)
=> sequence.Loop(Duration - command.Duration, LoopCount);
public override string ToString()
=> $"{startTime} x{loopCount}";
=> $"{LoopStartTime} x{LoopCount}";
}
}