-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from andy840119/andy840119/id-to-list-singer-…
…in-lyric Save list of singer index instead of font index in lyric.
- Loading branch information
Showing
20 changed files
with
141 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using NUnit.Framework; | ||
using osu.Game.Rulesets.Karaoke.Utils; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Tests.Utils | ||
{ | ||
[TestFixture] | ||
public class SingerUtilsTest | ||
{ | ||
[TestCase(null, 0)] | ||
[TestCase(new[] { 1 }, 1)] | ||
[TestCase(new[] { 1, 2, 3 }, 7)] | ||
[TestCase(new[] { 1, 4, 5 }, 25)] | ||
public void TestGetShiftingStyleIndex(int[] singerIndexs, int styleIndex) | ||
{ | ||
Assert.AreEqual(SingerUtils.GetShiftingStyleIndex(singerIndexs), styleIndex); | ||
} | ||
|
||
[TestCase(-1, new int[] { })] | ||
[TestCase(0, new int[] { })] | ||
[TestCase(1, new[] { 1 })] | ||
[TestCase(7, new[] { 1, 2, 3 })] | ||
[TestCase(25, new[] { 1, 4, 5 })] | ||
public void TestGetSingersIndex(int styleIndex, int[] singerIndexs) | ||
{ | ||
Assert.AreEqual(SingerUtils.GetSingersIndex(styleIndex), singerIndexs); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Objects.Types | ||
{ | ||
public interface IHasSingers | ||
{ | ||
int[] Singers { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Karaoke.Utils; | ||
using System.IO; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Skinning | ||
{ | ||
public readonly struct KaraokeSkinLookup | ||
{ | ||
/// <summary> | ||
/// Ctor for <see cref="KaraokeSkinConfiguration.LyricStyle"/> and <see cref="KaraokeSkinConfiguration.NoteStyle"/> | ||
/// </summary> | ||
/// <param name="config"></param> | ||
/// <param name="singers"></param> | ||
public KaraokeSkinLookup(KaraokeSkinConfiguration config, int[] singers) | ||
: this(config, SingerUtils.GetShiftingStyleIndex(singers)) | ||
{ | ||
if (config != KaraokeSkinConfiguration.LyricStyle && config != KaraokeSkinConfiguration.NoteStyle) | ||
throw new InvalidDataException($"Only {KaraokeSkinConfiguration.LyricStyle} and {KaraokeSkinConfiguration.NoteStyle} can call this ctor."); | ||
} | ||
|
||
public KaraokeSkinLookup(KaraokeSkinConfiguration config, int lookup) | ||
{ | ||
Config = config; | ||
|
Oops, something went wrong.