Make mods argument optional for storyboard construction

This commit is contained in:
Dean Herbert 2022-03-04 12:05:02 +09:00
parent b0688cc6dd
commit c38126ba9d
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -60,10 +61,10 @@ namespace osu.Game.Storyboards.Drawables
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
public DrawableStoryboard(Storyboard storyboard, IReadOnlyList<Mod> mods) public DrawableStoryboard(Storyboard storyboard, IReadOnlyList<Mod> mods = null)
{ {
Storyboard = storyboard; Storyboard = storyboard;
Mods = mods; Mods = mods ?? Array.Empty<Mod>();
Size = new Vector2(640, 480); Size = new Vector2(640, 480);

View File

@ -91,7 +91,7 @@ namespace osu.Game.Storyboards
} }
} }
public DrawableStoryboard CreateDrawable(IReadOnlyList<Mod> mods) => public DrawableStoryboard CreateDrawable(IReadOnlyList<Mod> mods = null) =>
new DrawableStoryboard(this, mods); new DrawableStoryboard(this, mods);
public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore) public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore)