Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new blank line inspections #4570

Merged
merged 8 commits into from May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/build.cake
@@ -1,5 +1,5 @@
#addin "nuget:?package=CodeFileSanity&version=0.0.21"
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.3.4"
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.1.1"
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();

Expand Down
2 changes: 2 additions & 0 deletions osu.Desktop/OsuGameDesktop.cs
Expand Up @@ -77,6 +77,7 @@ protected override void ScreenChanged(IScreen lastScreen, IScreen newScreen)
if (versionManager != null)
versionManager.State = Visibility.Visible;
break;

default:
if (versionManager != null)
versionManager.State = Visibility.Hidden;
Expand All @@ -87,6 +88,7 @@ protected override void ScreenChanged(IScreen lastScreen, IScreen newScreen)
public override void SetHost(GameHost host)
{
base.SetHost(host);

if (host.Window is DesktopGameWindow desktopWindow)
{
desktopWindow.CursorState |= CursorState.Hidden;
Expand Down
1 change: 1 addition & 0 deletions osu.Desktop/Overlays/VersionManager.cs
Expand Up @@ -95,6 +95,7 @@ protected override void LoadComplete()

var version = game.Version;
var lastVersion = config.Get<string>(OsuSetting.Version);

if (game.IsDeployedBuild && version != lastVersion)
{
config.Set(OsuSetting.Version, version);
Expand Down
1 change: 1 addition & 0 deletions osu.Desktop/Program.cs
Expand Up @@ -31,6 +31,7 @@ public static int Main(string[] args)
var importer = new ArchiveImportIPCChannel(host);
// Restore the cwd so relative paths given at the command line work correctly
Directory.SetCurrentDirectory(cwd);

foreach (var file in args)
{
Console.WriteLine(@"Importing {0}", file);
Expand Down
1 change: 1 addition & 0 deletions osu.Desktop/Updater/SimpleUpdateManager.cs
Expand Up @@ -78,6 +78,7 @@ private string getBestUrl(GitHubRelease release)
case RuntimeInfo.Platform.Windows:
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe"));
break;

case RuntimeInfo.Platform.MacOsx:
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip"));
break;
Expand Down
2 changes: 1 addition & 1 deletion osu.Desktop/Updater/SquirrelUpdateManager.cs
Expand Up @@ -175,7 +175,7 @@ private class SquirrelLogger : Splat.ILogger, IDisposable

public SquirrelLogger()
{
var file = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "SquirrelSetupUpdater.log");
var file = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location ?? Directory.GetCurrentDirectory()), "SquirrelSetupUpdater.log");
if (File.Exists(file)) File.Delete(file);
path = file;
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs
Expand Up @@ -36,11 +36,13 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
yield return new ConvertValue((CatchHitObject)nested);

break;

case BananaShower shower:
foreach (var nested in shower.NestedHitObjects)
yield return new ConvertValue((CatchHitObject)nested);

break;

default:
yield return new ConvertValue((CatchHitObject)hitObject);

Expand Down
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
Expand Up @@ -31,6 +31,7 @@ public override void PostProcess()
initialiseHyperDash((List<CatchHitObject>)Beatmap.HitObjects);

int index = 0;

foreach (var obj in Beatmap.HitObjects.OfType<CatchHitObject>())
{
obj.IndexInBeatmap = index++;
Expand Down Expand Up @@ -58,6 +59,7 @@ private void applyPositionOffsets()
}

break;

case JuiceStream juiceStream:
foreach (var nested in juiceStream.NestedHitObjects)
{
Expand Down Expand Up @@ -103,6 +105,7 @@ private void initialiseHyperDash(List<CatchHitObject> objects)
double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 1/4th of a frame of grace time, taken from osu-stable
double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth);
float distanceToHyper = (float)(timeToNext * CatcherArea.Catcher.BASE_SPEED - distanceToNext);

if (distanceToHyper < 0)
{
currentObject.HyperDashTarget = nextObject;
Expand Down
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Catch/CatchRuleset.cs
Expand Up @@ -87,6 +87,7 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
new CatchModNoFail(),
new MultiMod(new CatchModHalfTime(), new CatchModDaycore())
};

case ModType.DifficultyIncrease:
return new Mod[]
{
Expand All @@ -96,17 +97,20 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
new CatchModHidden(),
new CatchModFlashlight(),
};

case ModType.Automation:
return new Mod[]
{
new MultiMod(new CatchModAutoplay(), new ModCinema()),
new CatchModRelax(),
};

case ModType.Fun:
return new Mod[]
{
new MultiMod(new ModWindUp<CatchHitObject>(), new ModWindDown<CatchHitObject>())
};

default:
return new Mod[] { };
}
Expand Down
Expand Up @@ -73,6 +73,7 @@ protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(I

lastObject = hitObject;
break;

case JuiceStream _:
foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>().Where(o => !(o is TinyDroplet)))
{
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Catch/Judgements/CatchBananaJudgement.cs
Expand Up @@ -16,6 +16,7 @@ protected override int NumericResultFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 1100;
}
Expand All @@ -27,6 +28,7 @@ protected override double HealthIncreaseFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 0.008;
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
Expand Up @@ -13,6 +13,7 @@ protected override int NumericResultFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 30;
}
Expand All @@ -24,6 +25,7 @@ protected override double HealthIncreaseFor(HitResult result)
{
default:
return base.HealthIncreaseFor(result);

case HitResult.Perfect:
return 0.007;
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs
Expand Up @@ -17,6 +17,7 @@ protected override int NumericResultFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 300;
}
Expand All @@ -28,6 +29,7 @@ protected override double HealthIncreaseFor(HitResult result)
{
default:
return -0.02;

case HitResult.Perfect:
return 0.01;
}
Expand Down
Expand Up @@ -15,6 +15,7 @@ protected override int NumericResultFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 10;
}
Expand All @@ -26,6 +27,7 @@ protected override double HealthIncreaseFor(HitResult result)
{
default:
return 0;

case HitResult.Perfect:
return 0.004;
}
Expand Down
Expand Up @@ -84,6 +84,7 @@ protected override void UpdateState(ArmedState state)
case ArmedState.Miss:
this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire();
break;

case ArmedState.Hit:
this.FadeOut().Expire();
break;
Expand Down
11 changes: 11 additions & 0 deletions osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs
Expand Up @@ -106,6 +106,7 @@ private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation represe
{
default:
return new Container();

case FruitVisualRepresentation.Raspberry:
return new Container
{
Expand Down Expand Up @@ -144,6 +145,7 @@ private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation represe
},
}
};

case FruitVisualRepresentation.Pineapple:
return new Container
{
Expand Down Expand Up @@ -182,6 +184,7 @@ private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation represe
},
}
};

case FruitVisualRepresentation.Pear:
return new Container
{
Expand Down Expand Up @@ -214,6 +217,7 @@ private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation represe
},
}
};

case FruitVisualRepresentation.Grape:
return new Container
{
Expand Down Expand Up @@ -246,6 +250,7 @@ private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation represe
},
}
};

case FruitVisualRepresentation.Banana:
return new Container
{
Expand Down Expand Up @@ -283,19 +288,25 @@ private Color4 colourForRepresentation(FruitVisualRepresentation representation)
default:
case FruitVisualRepresentation.Pear:
return new Color4(17, 136, 170, 255);

case FruitVisualRepresentation.Grape:
return new Color4(204, 102, 0, 255);

case FruitVisualRepresentation.Raspberry:
return new Color4(121, 9, 13, 255);

case FruitVisualRepresentation.Pineapple:
return new Color4(102, 136, 0, 255);

case FruitVisualRepresentation.Banana:
switch (RNG.Next(0, 3))
{
default:
return new Color4(255, 240, 0, 255);

case 1:
return new Color4(255, 192, 0, 255);

case 2:
return new Color4(214, 221, 28, 255);
}
Expand Down
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Catch/Objects/JuiceStream.cs
Expand Up @@ -95,6 +95,7 @@ protected override void CreateNestedHitObjects()
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
});
break;

case SliderEventType.Head:
case SliderEventType.Tail:
case SliderEventType.Repeat:
Expand Down
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
Expand Up @@ -32,6 +32,7 @@ protected override double HealthAdjustmentFactorFor(JudgementResult result)
{
case HitResult.Miss:
return hpDrainRate;

default:
return 10.2 - hpDrainRate; // Award less HP as drain rate is increased
}
Expand Down
5 changes: 5 additions & 0 deletions osu.Game.Rulesets.Catch/UI/CatcherArea.cs
Expand Up @@ -292,6 +292,7 @@ public void SetHyperDashState(double modifier = 1, float targetPosition = -1)
const float hyper_dash_transition_length = 180;

bool previouslyHyperDashing = HyperDashing;

if (modifier <= 1 || X == targetPosition)
{
hyperDashModifier = 1;
Expand Down Expand Up @@ -325,9 +326,11 @@ public bool OnPressed(CatchAction action)
case CatchAction.MoveLeft:
currentDirection--;
return true;

case CatchAction.MoveRight:
currentDirection++;
return true;

case CatchAction.Dash:
Dashing = true;
return true;
Expand All @@ -343,9 +346,11 @@ public bool OnReleased(CatchAction action)
case CatchAction.MoveLeft:
currentDirection++;
return true;

case CatchAction.MoveRight:
currentDirection--;
return true;

case CatchAction.Dash:
Dashing = false;
return true;
Expand Down
5 changes: 5 additions & 0 deletions osu.Game.Rulesets.Catch/UI/DrawableCatchRuleset.cs
Expand Up @@ -48,14 +48,19 @@ public override DrawableHitObject<CatchHitObject> CreateDrawableRepresentation(C
{
case Banana banana:
return new DrawableBanana(banana);

case Fruit fruit:
return new DrawableFruit(fruit);

case JuiceStream stream:
return new DrawableJuiceStream(stream, CreateDrawableRepresentation);

case BananaShower shower:
return new DrawableBananaShower(shower, CreateDrawableRepresentation);

case TinyDroplet tiny:
return new DrawableTinyDroplet(tiny);

case Droplet droplet:
return new DrawableDroplet(droplet);
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs
Expand Up @@ -168,11 +168,13 @@ protected override void Update()
foreach (var nested in obj.NestedHitObjects)
{
double finalPosition = (nested.HitObject.StartTime - obj.HitObject.StartTime) / endTime.Duration;

switch (direction)
{
case ScrollingDirection.Up:
nested.Y = (float)(finalPosition * content.DrawHeight);
break;

case ScrollingDirection.Down:
nested.Y = (float)(-finalPosition * content.DrawHeight);
break;
Expand Down
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
Expand Up @@ -48,6 +48,7 @@ public ManiaBeatmapConverter(IBeatmap beatmap)
if (IsForCurrentRuleset)
{
TargetColumns = (int)Math.Max(1, roundedCircleSize);

if (TargetColumns >= 10)
{
TargetColumns = TargetColumns / 2;
Expand Down