// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable namespace osu.Framework.Timing { /// /// A framed clock which allows an offset to be added or subtracted from an underlying source clock's time. /// public class FramedOffsetClock : FramedClock { public override double CurrentTime => base.CurrentTime + offset; private double offset; /// /// The offset to be applied. /// /// /// A positive offset will move time forward. /// public double Offset { get => offset; set { LastFrameTime += value - offset; offset = value; } } public FramedOffsetClock(IClock source, bool processSource = true) : base(source, processSource) { } } }