A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using System;
5using osu.Framework.Allocation;
6using osu.Framework.Timing;
7
8namespace osu.Framework.Graphics.Transforms
9{
10 public interface ITransformable
11 {
12 /// <summary>
13 /// Start a sequence of <see cref="Transform"/>s with a (cumulative) relative delay applied.
14 /// </summary>
15 /// <param name="delay">The offset in milliseconds from current time. Note that this stacks with other nested sequences.</param>
16 /// <param name="recursive">Whether this should be applied to all children. True by default.</param>
17 /// <returns>An <see cref="InvokeOnDisposal"/> to be used in a using() statement.</returns>
18 IDisposable BeginDelayedSequence(double delay, bool recursive = true);
19
20 /// <summary>
21 /// Start a sequence of <see cref="Transform"/>s from an absolute time value (adjusts <see cref="TransformStartTime"/>).
22 /// </summary>
23 /// <param name="newTransformStartTime">The new value for <see cref="TransformStartTime"/>.</param>
24 /// <param name="recursive">Whether this should be applied to all children. True by default.</param>
25 /// <returns>An <see cref="InvokeOnDisposal"/> to be used in a using() statement.</returns>
26 /// <exception cref="InvalidOperationException">Absolute sequences should never be nested inside another existing sequence.</exception>
27 IDisposable BeginAbsoluteSequence(double newTransformStartTime, bool recursive = true);
28
29 /// <summary>
30 /// The current frame's time as observed by this class's <see cref="Transform"/>s.
31 /// </summary>
32 FrameTimeInfo Time { get; }
33
34 double TransformStartTime { get; }
35
36 void AddTransform(Transform transform, ulong? customTransformID = null);
37
38 void RemoveTransform(Transform toRemove);
39 }
40}