1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 15:27:26 +08:00
osu-lazer/osu.Game/Storyboards/IStoryboardElement.cs

31 lines
1.1 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics;
namespace osu.Game.Storyboards
{
public interface IStoryboardElement
{
string Path { get; }
bool IsDrawable { get; }
double StartTime { get; }
2018-04-13 17:19:50 +08:00
Drawable CreateDrawable();
}
public static class StoryboardElementExtensions
{
/// <summary>
/// Returns the end time of this object.
/// </summary>
/// <remarks>
/// This returns the <see cref="IStoryboardElementHasDuration.EndTime"/> where available, falling back to <see cref="IStoryboardElement.StartTime"/> otherwise.
/// </remarks>
/// <param name="storyboardElement">The object.</param>
/// <returns>The end time of this object.</returns>
public static double GetEndTime(this IStoryboardElement storyboardElement) => (storyboardElement as IStoryboardElementHasDuration)?.EndTime ?? storyboardElement.StartTime;
}
2018-04-13 17:19:50 +08:00
}