-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 #74 from LumpBloom7/Slides
Implement Slide notes
- Loading branch information
Showing
34 changed files
with
1,110 additions
and
25 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneCircleSlide.cs
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,21 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
using osu.Framework.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneCircleSlide : TestSceneSlide | ||
{ | ||
private bool clockwise = false; | ||
public TestSceneCircleSlide() | ||
{ | ||
AddToggleStep("Clockwise", b => | ||
{ | ||
clockwise = b; | ||
RefreshSlide(); | ||
}); | ||
} | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateCirclePattern(EndPath, clockwise ? RotationDirection.Clockwise : RotationDirection.CounterClockwise); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneLSlide.cs
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,11 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneLSlide : TestSceneSlide | ||
{ | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateLPattern(EndPath); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneSlide.cs
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,51 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.UI.Components; | ||
using osu.Game.Tests.Visual; | ||
using NUnit.Framework; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables.Pieces; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
[TestFixture] | ||
public abstract class TestSceneSlide : OsuTestScene | ||
{ | ||
protected override Ruleset CreateRuleset() => new SentakkiRuleset(); | ||
|
||
protected int StartPath = 0; | ||
protected int EndPath; | ||
|
||
private readonly SlideBody slide; | ||
|
||
public TestSceneSlide() | ||
{ | ||
Add(new SentakkiRing()); | ||
|
||
Add(slide = new SlideBody() | ||
{ | ||
Path = CreatePattern().Path | ||
}); | ||
|
||
AddSliderStep("Path offset", 0, 7, 0, p => | ||
{ | ||
slide.Rotation = 45 * p; | ||
}); | ||
AddSliderStep("End Path", 0, 7, 4, p => | ||
{ | ||
EndPath = p; | ||
RefreshSlide(); | ||
}); | ||
AddSliderStep("Progress", 0.0f, 1.0f, 0.0f, p => | ||
{ | ||
slide.Progress = p; | ||
}); | ||
} | ||
protected abstract SentakkiSlidePath CreatePattern(); | ||
|
||
protected void RefreshSlide() | ||
{ | ||
slide.Path = CreatePattern().Path; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneStraightSlide.cs
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,11 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneStraightSlide : TestSceneSlide | ||
{ | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateStraightPattern(EndPath); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneThunderSlide.cs
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,11 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneThunderSlide : TestSceneSlide | ||
{ | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateThunderPattern(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneUSlide.cs
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,11 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneUSlide : TestSceneSlide | ||
{ | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateUPattern(EndPath); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
osu.Game.Rulesets.Sentakki.Tests/Objects/Slides/TestSceneVSlide.cs
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,11 @@ | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects.Slides | ||
{ | ||
public class TestSceneVSlide : TestSceneSlide | ||
{ | ||
protected override SentakkiSlidePath CreatePattern() => SlidePaths.GenerateVPattern(EndPath); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs
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,55 @@ | ||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Rulesets.Sentakki.Objects; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Sentakki.Objects.Drawables; | ||
using osu.Game.Tests.Visual; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
using System.Linq; | ||
|
||
namespace osu.Game.Rulesets.Sentakki.Tests.Objects | ||
{ | ||
[TestFixture] | ||
public class TestSceneSlideNote : OsuTestScene | ||
{ | ||
private readonly Container content; | ||
protected override Container<Drawable> Content => content; | ||
|
||
protected override Ruleset CreateRuleset() => new SentakkiRuleset(); | ||
|
||
private int depthIndex; | ||
|
||
public TestSceneSlideNote() | ||
{ | ||
base.Content.Add(content = new SentakkiInputManager(new RulesetInfo { ID = 0 })); | ||
|
||
AddStep("Miss Single", () => testSingle(2000)); | ||
AddStep("Hit Single", () => testSingle(2000, true)); | ||
AddUntilStep("Wait for object despawn", () => !Children.Any(h => (h is DrawableSentakkiHitObject) && (h as DrawableSentakkiHitObject).AllJudged == false)); | ||
} | ||
|
||
private void testSingle(double duration, bool auto = false) | ||
{ | ||
var slide = new Slide | ||
{ | ||
SlidePath = SlidePaths.GenerateUPattern(5), | ||
StartTime = Time.Current + 1000, | ||
EndTime = Time.Current + 1000 + duration, | ||
}; | ||
|
||
slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { }); | ||
|
||
Add(new DrawableSlide(slide) | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
Depth = depthIndex++, | ||
Auto = auto | ||
}); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.