-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ppy:master' into pattern-2
- Loading branch information
Showing
109 changed files
with
746 additions
and
631 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
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,41 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Linq; | ||
using osu.Game.Rulesets.Catch.Objects; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Screens.Edit.Compose.Components; | ||
|
||
namespace osu.Game.Rulesets.Catch.Edit | ||
{ | ||
public partial class CatchHitObjectInspector(CatchDistanceSnapProvider snapProvider) : HitObjectInspector | ||
{ | ||
protected override void AddInspectorValues(HitObject[] objects) | ||
{ | ||
base.AddInspectorValues(objects); | ||
|
||
if (objects.Length > 0) | ||
{ | ||
HitObject firstSelectedHitObject = objects.MinBy(ho => ho.StartTime)!; | ||
HitObject lastSelectedHitObject = objects.MaxBy(ho => ho.GetEndTime())!; | ||
|
||
HitObject? precedingObject = EditorBeatmap.HitObjects.LastOrDefault(ho => ho.GetEndTime() < firstSelectedHitObject.StartTime); | ||
HitObject? nextObject = EditorBeatmap.HitObjects.FirstOrDefault(ho => ho.StartTime > lastSelectedHitObject.GetEndTime()); | ||
|
||
if (precedingObject != null && precedingObject is not BananaShower) | ||
{ | ||
double previousSnap = snapProvider.ReadCurrentDistanceSnap(precedingObject, firstSelectedHitObject); | ||
AddHeader("To previous"); | ||
AddValue($"{previousSnap:#,0.##}x"); | ||
} | ||
|
||
if (nextObject != null && nextObject is not BananaShower) | ||
{ | ||
double nextSnap = snapProvider.ReadCurrentDistanceSnap(lastSelectedHitObject, nextObject); | ||
AddHeader("To next"); | ||
AddValue($"{nextSnap:#,0.##}x"); | ||
} | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using osu.Game.Rulesets.Mania.Scoring; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Mania.Tests | ||
{ | ||
[TestFixture] | ||
public class ManiaScoreProcessorTest | ||
{ | ||
[TestCase(ScoreRank.X, 1, HitResult.Perfect)] | ||
[TestCase(ScoreRank.X, 0.99, HitResult.Great)] | ||
[TestCase(ScoreRank.D, 0.1, HitResult.Great)] | ||
[TestCase(ScoreRank.X, 0.99, HitResult.Perfect, HitResult.Great)] | ||
[TestCase(ScoreRank.X, 0.99, HitResult.Great, HitResult.Great)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Perfect, HitResult.Good)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Perfect, HitResult.Ok)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Perfect, HitResult.Meh)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Perfect, HitResult.Miss)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Great, HitResult.Good)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Great, HitResult.Ok)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Great, HitResult.Meh)] | ||
[TestCase(ScoreRank.S, 0.99, HitResult.Great, HitResult.Miss)] | ||
public void TestRanks(ScoreRank expected, double accuracy, params HitResult[] results) | ||
{ | ||
var scoreProcessor = new ManiaScoreProcessor(); | ||
|
||
Dictionary<HitResult, int> resultsDict = new Dictionary<HitResult, int>(); | ||
foreach (var result in results) | ||
resultsDict[result] = resultsDict.GetValueOrDefault(result) 1; | ||
|
||
Assert.That(scoreProcessor.RankFromScore(accuracy, resultsDict), Is.EqualTo(expected)); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.