1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Update code style

Sorry, bot overlords.
This commit is contained in:
Poyo 2018-02-26 00:18:54 -08:00
parent 31cf00e3b8
commit 96f416fef3
2 changed files with 8 additions and 9 deletions

View File

@ -9,7 +9,7 @@ using System.Collections.Generic;
namespace osu.Game.Rulesets.Mania
{
public class ManiaDifficultyCalculator : DifficultyCalculator<ManiaHitObject>
internal class ManiaDifficultyCalculator : DifficultyCalculator<ManiaHitObject>
{
private const double star_scaling_factor = 0.018;
@ -18,12 +18,12 @@ namespace osu.Game.Rulesets.Mania
/// This is to eliminate higher influence of stream over aim by simply having more HitObjects with high strain.
/// The higher this value, the less strains there will be, indirectly giving long beatmaps an advantage.
/// </summary>
protected const double strain_step = 400;
private const double strain_step = 400;
/// <summary>
/// The weighting of each strain value decays to this number * it's previous value
/// </summary>
protected const double decay_weight = 0.9;
private const double decay_weight = 0.9;
/// <summary>
/// HitObjects are stored as a member variable.
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Mania
// Fill our custom DifficultyHitObject class, that carries additional information
difficultyHitObjects.Clear();
int columnCount = (Beatmap as ManiaBeatmap).TotalColumns;
int columnCount = (Beatmap as ManiaBeatmap)?.TotalColumns ?? 7;
foreach (var hitObject in Beatmap.HitObjects)
difficultyHitObjects.Add(new ManiaHitObjectDifficulty(hitObject, columnCount));

View File

@ -6,7 +6,7 @@ using System;
namespace osu.Game.Rulesets.Mania.Objects
{
class ManiaHitObjectDifficulty
internal class ManiaHitObjectDifficulty
{
/// <summary>
/// Factor by how much individual / overall strain decays per second.
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.Objects
internal ManiaHitObject BaseHitObject;
private int beatmapColumnCount;
private readonly int beatmapColumnCount;
private double endTime;
@ -68,7 +68,6 @@ namespace osu.Game.Rulesets.Mania.Objects
internal void CalculateStrains(ManiaHitObjectDifficulty previousHitObject, double timeRate)
{
// TODO: Factor in holds
double addition = 1.0;
double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate;
double individualDecay = Math.Pow(INDIVIDUAL_DECAY_BASE, timeElapsed / 1000);
double overallDecay = Math.Pow(OVERALL_DECAY_BASE, timeElapsed / 1000);
@ -106,9 +105,9 @@ namespace osu.Game.Rulesets.Mania.Objects
heldUntil[BaseHitObject.Column] = endTime;
// Increase individual strain in own column
IndividualStrain += (2.0/* + (double)SpeedMania.Column / 8.0*/) * holdFactor;
IndividualStrain += 2.0 * holdFactor;
OverallStrain = previousHitObject.OverallStrain * overallDecay + (addition + holdAddition) * holdFactor;
OverallStrain = previousHitObject.OverallStrain * overallDecay + (1.0 + holdAddition) * holdFactor;
}
}
}