1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Add JsonIgnores to CommandTimelineGroup

This commit is contained in:
smoogipoo 2017-12-06 13:46:49 +09:00
parent e199ee5225
commit 44edb8724f

View File

@ -6,6 +6,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
namespace osu.Game.Storyboards
{
@ -23,6 +24,7 @@ namespace osu.Game.Storyboards
public CommandTimeline<bool> FlipH = new CommandTimeline<bool>();
public CommandTimeline<bool> FlipV = new CommandTimeline<bool>();
[JsonIgnore]
public IEnumerable<ICommandTimeline> Timelines
{
get
@ -39,14 +41,25 @@ namespace osu.Game.Storyboards
}
}
[JsonIgnore]
public double CommandsStartTime => Timelines.Where(t => t.HasCommands).Min(t => t.StartTime);
[JsonIgnore]
public double CommandsEndTime => Timelines.Where(t => t.HasCommands).Max(t => t.EndTime);
[JsonIgnore]
public double CommandsDuration => CommandsEndTime - CommandsStartTime;
[JsonIgnore]
public virtual double StartTime => CommandsStartTime;
[JsonIgnore]
public virtual double EndTime => CommandsEndTime;
[JsonIgnore]
public double Duration => EndTime - StartTime;
[JsonIgnore]
public bool HasCommands => Timelines.Any(t => t.HasCommands);
public virtual IEnumerable<CommandTimeline<T>.TypedCommand> GetCommands<T>(CommandTimelineSelector<T> timelineSelector, double offset = 0)