Skip to content

Commit

Permalink
Fix ruleset errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EVAST9919 committed Feb 19, 2022
1 parent 37104a7 commit 4dc18e5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
<StartupObject>osu.Game.Rulesets.Touhosu.Tests.VisualTestRunner</StartupObject>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup Label="Service">
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<PropertyGroup>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
Expand All @@ -21,7 +15,7 @@
</ItemGroup>
<PropertyGroup Label="Project">
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>osu.Game.Rulesets.Touhosu.Tests</RootNamespace>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Rulesets.Difficulty;

namespace osu.Game.Rulesets.Touhosu.Difficulty
{
public class TouhosuPerformanceAttributes : PerformanceAttributes
{
[JsonProperty("accuracy")]
public double Accuracy { get; set; }

public override IEnumerable<PerformanceDisplayAttribute> GetAttributesForDisplay()
{
foreach (var attribute in base.GetAttributesForDisplay())
yield return attribute;

yield return new PerformanceDisplayAttribute(nameof(Accuracy), "Accuracy", Accuracy);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using osu.Game.Rulesets.Difficulty;
using osu.Game.Scoring;

namespace osu.Game.Rulesets.Touhosu.Difficulty
{
public class TouhosuPerformanceCalculator : PerformanceCalculator
{
public TouhosuPerformanceCalculator(Ruleset ruleset, DifficultyAttributes attributes, ScoreInfo score)
: base(ruleset, attributes, score)
{
}
public override PerformanceAttributes Calculate()
{
double accuracyValue = 0.0;
return new TouhosuPerformanceAttributes
{
Accuracy = accuracyValue
};
}
}
}
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Touhosu/TouhosuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Rulesets.Touhosu.Replays;
using osu.Game.Scoring;

namespace osu.Game.Rulesets.Touhosu
{
Expand Down Expand Up @@ -110,5 +111,7 @@ protected override IEnumerable<HitResult> GetValidHitResults() => new[]
};

public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new TouhosuDifficultyCalculator(RulesetInfo, beatmap);

public override PerformanceCalculator CreatePerformanceCalculator(DifficultyAttributes attributes, ScoreInfo score) => new TouhosuPerformanceCalculator(this, attributes, score);
}
}
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Touhosu/osu.Game.Rulesets.Touhosu.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyTitle>osu.Game.Rulesets.Touhosu</AssemblyTitle>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -11,6 +11,6 @@
<EmbeddedResource Include="Resources\**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.205.0" />
<PackageReference Include="ppy.osu.Game" Version="2022.217.0"/>
</ItemGroup>
</Project>

0 comments on commit 4dc18e5

Please sign in to comment.