Skip to content

Commit

Permalink
Update to NET8
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Feb 21, 2024
1 parent 67e5648 commit abd9466
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"program": "dotnet",
"args": [
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Debug/net6.0/osu.Game.Rulesets.Rush.Tests.dll"
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Debug/net8.0/osu.Game.Rulesets.Rush.Tests.dll"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Build tests (Debug)",
Expand All @@ -19,7 +19,7 @@
"request": "launch",
"program": "dotnet",
"args": [
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Release/net6.0/osu.Game.Rulesets.Rush.Tests.dll"
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Release/net8.0/osu.Game.Rulesets.Rush.Tests.dll"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Build tests (Release)",
Expand All @@ -31,7 +31,7 @@
"request": "launch",
"program": "dotnet",
"args": [
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Development/net6.0/osu.Game.Rulesets.Rush.Tests.dll"
"${workspaceRoot}/osu.Game.Rulesets.Rush.Tests/bin/Development/net8.0/osu.Game.Rulesets.Rush.Tests.dll"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Build tests (Development)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>
<PropertyGroup Label="Project">
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Development' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush/Input/RushInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class RushInputManager : RulesetInputManager<RushAction>
/// <summary>
/// Retrieves all actions in a currenty pressed states.
/// </summary>
public SlimReadOnlyListWrapper<RushAction> PressedActions => ((List<RushAction>)KeyBindingContainer.PressedActions).AsSlimReadOnly();
public SlimReadOnlyListWrapper<RushAction> PressedActions => KeyBindingContainer.PressedActions;

public RushInputManager(RulesetInfo ruleset)
: base(ruleset, 0, SimultaneousBindingMode.Unique)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)

// We can judge this object the instant the nested objects are judged
if (Air.AllJudged && Ground.AllJudged)
ApplyResult(r => r.Type = (Air.IsHit && Ground.IsHit) ? r.Judgement.MaxResult : r.Judgement.MinResult);
ApplyResult((Air.IsHit && Ground.IsHit) ? Result.Judgement.MaxResult : Result.Judgement.MinResult);
}

protected override void UpdateHitStateTransforms(ArmedState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;

namespace osu.Game.Rulesets.Rush.Objects.Drawables
{
Expand All @@ -21,10 +22,10 @@ public DrawableFeverBonus(FeverBonus hitObject)
{
}

public new void ApplyResult(Action<JudgementResult> application)
public new void ApplyResult(HitResult result)
{
if (!Result.HasResult)
base.ApplyResult(application);
base.ApplyResult(result);
}

protected override void CheckForResult(bool userTriggered, double timeOffset)
Expand Down
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Rush/Objects/Drawables/DrawableHeart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (userTriggered)
{
if (result != HitResult.None)
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);

return;
}
Expand All @@ -65,11 +65,11 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)

// if we've passed the object and can longer hit it, miss
if (result == HitResult.None)
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);

// else if we're still able to hit it, check if the player is in the correct lane
else if (playfield.PlayerSprite.CollidesWith(HitObject))
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
}
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Rush/Objects/Drawables/DrawableLanedHit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (!userTriggered)
{
if (!HitObject.HitWindows.CanBeHit(timeOffset))
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);
return;
}

var result = HitObject.HitWindows.ResultFor(timeOffset);
if (result == HitResult.None)
return;

ApplyResult(r => r.Type = result);
ApplyResult(result);
}

protected override void UpdateHitStateTransforms(ArmedState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
? HitResult.Good
: HitResult.Miss;

ApplyResult(r => r.Type = hitResult);
ApplyResult(hitResult);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DrawableMiniBossTick(MiniBossTick hitObject)
public void TriggerResult(HitResult type)
{
HitObject.StartTime = Time.Current;
ApplyResult(r => r.Type = type);
ApplyResult(type);
}

protected override void CheckForResult(bool userTriggered, double timeOffset)
Expand Down
18 changes: 7 additions & 11 deletions osu.Game.Rulesets.Rush/Objects/Drawables/DrawableRushHitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using osu.Game.Rulesets.Rush.Judgements;
using osu.Game.Rulesets.Rush.UI;
using osu.Game.Rulesets.Rush.UI.Fever;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI.Scrolling;
using osuTK.Graphics;

Expand Down Expand Up @@ -75,7 +76,7 @@ protected virtual void OnDirectionChanged(ValueChangedEvent<ScrollingDirection>
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (timeOffset >= 0)
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
}

public virtual bool OnPressed(KeyBindingPressEvent<RushAction> e) => false;
Expand Down Expand Up @@ -106,24 +107,19 @@ protected override void UpdateHitStateTransforms(ArmedState state)

protected override JudgementResult CreateResult(Judgement judgement) => new RushJudgementResult(HitObject, (RushJudgement)judgement);

protected new void ApplyResult(Action<JudgementResult> application)
protected new void ApplyResult(HitResult result)
{
// This is the only point to correctly apply values to the judgement
// result in correct time, check whether the player collided now.
void rushApplication(JudgementResult br)
{
var r = (RushJudgementResult)br;

application?.Invoke(r);
r.PlayerCollided = drawableRuleset.PlayerCollidesWith(r.HitObject);
};
var r = (RushJudgementResult)Result;
r.PlayerCollided = drawableRuleset.PlayerCollidesWith(r.HitObject);

base.ApplyResult(rushApplication);
base.ApplyResult(result);

foreach (var bonus in feverBonusContainer)
{
bool eligible = IsHit && feverProcessor.InFeverMode.Value;
bonus.ApplyResult(result => result.Type = eligible ? result.Judgement.MaxResult : result.Judgement.MinResult);
bonus.ApplyResult(eligible ? bonus.Result.Judgement.MaxResult : bonus.Result.Judgement.MinResult);
}
}

Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Rush/Objects/Drawables/DrawableSawblade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
{
case HitResult.None:
// if we've reached the trailing "none", we successfully dodged the sawblade
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
break;

case HitResult.Miss:
// sawblades only hurt the player if they collide within the trailing "miss" hit window
if (playfield.PlayerSprite.CollidesWith(HitObject))
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);

break;
}
Expand Down
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Rush/Objects/Drawables/DrawableStarSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
// Head missed, judge as overall missed.
if (Head.Result.Type == Head.Result.Judgement.MinResult)
{
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);
return;
}

Expand All @@ -157,7 +157,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
// Released before required progress for completion, judge as overall missed.
if (userTriggered && Progress < REQUIRED_COMPLETION)
{
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);
return;
}

Expand All @@ -169,7 +169,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (!Tail.Judged)
return;

ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
}

private bool iHandledPressed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (result == HitResult.None)
return;

ApplyResult(r => r.Type = result);
ApplyResult(result);
}
else if (!HitObject.HitWindows.CanBeHit(timeOffset))
{
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
// Apply tail miss at its time when the entire star sheet has already been judged as missed.
if (overallMissed && timeOffset >= 0)
{
ApplyResult(r => r.Type = r.Judgement.MinResult);
ApplyResult(Result.Judgement.MinResult);
return;
}

// for now let's give the player an automatic perfect if they hold the action (like in a certain other rhythm game)
if (!userTriggered)
{
if (timeOffset >= 0)
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
return;
}

Expand All @@ -47,7 +47,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
return;

// ...and an automatic perfect if they release within any "hit" judged period
ApplyResult(r => r.Type = r.Judgement.MaxResult);
ApplyResult(Result.Judgement.MaxResult);
}
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Rush/osu.Game.Rulesets.Rush.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<Configurations>Debug;Release;Development</Configurations>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Rush</RootNamespace>
Expand Down Expand Up @@ -33,6 +33,6 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2024.130.2" />
<PackageReference Include="ppy.osu.Game" Version="2024.221.0" />
</ItemGroup>
</Project>

0 comments on commit abd9466

Please sign in to comment.