// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Beatmaps; using osu.Game.Storyboards; namespace osu.Game.Rulesets.Edit.Checks.Components { public static class ResourcesCheckUtils { /// /// Checks if any storyboard element is present in the working beatmap. /// /// The working beatmap to check. /// True if any storyboard element is present, false otherwise. public static bool HasAnyStoryboardElementPresent(IWorkingBeatmap workingBeatmap) { foreach (var layer in workingBeatmap.Storyboard.Layers) { foreach (var _ in layer.Elements) { return true; } } return false; } /// /// Retrieves the first storyboard video entry for the provided working beatmap, if any. /// /// The working beatmap to inspect. /// /// The first found, or null if none exists. /// public static StoryboardVideo? GetDifficultyVideo(IWorkingBeatmap workingBeatmap) { foreach (var layer in workingBeatmap.Storyboard.Layers) { foreach (var element in layer.Elements) { if (element is StoryboardVideo video) return video; } } return null; } } }