public OsbAnimationWriter(OsbAnimation osbAnimation, AnimatedValue <CommandPosition> moveTimeline,
                           AnimatedValue <CommandDecimal> moveXTimeline,
                           AnimatedValue <CommandDecimal> moveYTimeline,
                           AnimatedValue <CommandDecimal> scaleTimeline,
                           AnimatedValue <CommandScale> scaleVecTimeline,
                           AnimatedValue <CommandDecimal> rotateTimeline,
                           AnimatedValue <CommandDecimal> fadeTimeline,
                           AnimatedValue <CommandColor> colorTimeline,
                           TextWriter writer, ExportSettings exportSettings, OsbLayer layer)
     : base(osbAnimation, moveTimeline,
            moveXTimeline,
            moveYTimeline,
            scaleTimeline,
            scaleVecTimeline,
            rotateTimeline,
            fadeTimeline,
            colorTimeline,
            writer, exportSettings, layer)
 {
     this.osbAnimation = osbAnimation;
 }
        protected override OsbSprite CreateSprite(List <IFragmentableCommand> segment)
        {
            if (osbAnimation.LoopType == OsbLoopType.LoopOnce && segment.Min(c => c.StartTime) >= osbAnimation.AnimationEndTime)
            {
                //this shouldn't loop again so we need a sprite instead
                var sprite = new OsbSprite()
                {
                    InitialPosition = osbAnimation.InitialPosition,
                    Origin          = osbAnimation.Origin,
                    TexturePath     = getLastFramePath(),
                };

                foreach (var command in segment)
                {
                    sprite.AddCommand(command);
                }

                return(sprite);
            }
            else
            {
                var animation = new OsbAnimation()
                {
                    TexturePath     = osbAnimation.TexturePath,
                    InitialPosition = osbAnimation.InitialPosition,
                    Origin          = osbAnimation.Origin,
                    FrameCount      = osbAnimation.FrameCount,
                    FrameDelay      = osbAnimation.FrameDelay,
                    LoopType        = osbAnimation.LoopType,
                };

                foreach (var command in segment)
                {
                    animation.AddCommand(command);
                }

                return(animation);
            }
        }