Skip to content

Commit

Permalink
Cleanup code style inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Dec 5, 2022
1 parent 6112acf commit 806fae1
Show file tree
Hide file tree
Showing 97 changed files with 1,376 additions and 1,004 deletions.
16 changes: 8 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trim_trailing_whitespace = true

#PascalCase for public and protected members
dotnet_naming_style.pascalcase.capitalization = pascal_case
dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event
dotnet_naming_symbols.public_members.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
dotnet_naming_symbols.public_members.applicable_kinds = property, method, field, event
dotnet_naming_rule.public_members_pascalcase.severity = error
dotnet_naming_rule.public_members_pascalcase.symbols = public_members
dotnet_naming_rule.public_members_pascalcase.style = pascalcase
Expand All @@ -22,7 +22,7 @@ dotnet_naming_rule.public_members_pascalcase.style = pascalcase
dotnet_naming_style.camelcase.capitalization = camel_case

dotnet_naming_symbols.private_members.applicable_accessibilities = private
dotnet_naming_symbols.private_members.applicable_kinds = property,method,field,event
dotnet_naming_symbols.private_members.applicable_kinds = property, method, field, event
dotnet_naming_rule.private_members_camelcase.severity = warning
dotnet_naming_rule.private_members_camelcase.symbols = private_members
dotnet_naming_rule.private_members_camelcase.style = camelcase
Expand All @@ -44,7 +44,7 @@ dotnet_naming_rule.private_const_all_lower.symbols = private_constants
dotnet_naming_rule.private_const_all_lower.style = all_lower

dotnet_naming_symbols.private_static_readonly.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly.required_modifiers = static,readonly
dotnet_naming_symbols.private_static_readonly.required_modifiers = static, readonly
dotnet_naming_symbols.private_static_readonly.applicable_kinds = field
dotnet_naming_rule.private_static_readonly_all_lower.severity = warning
dotnet_naming_rule.private_static_readonly_all_lower.symbols = private_static_readonly
Expand All @@ -60,15 +60,15 @@ dotnet_naming_rule.local_const_all_lower.style = all_lower
dotnet_naming_style.all_upper.capitalization = all_upper
dotnet_naming_style.all_upper.word_separator = _

dotnet_naming_symbols.public_constants.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_constants.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
dotnet_naming_symbols.public_constants.required_modifiers = const
dotnet_naming_symbols.public_constants.applicable_kinds = field
dotnet_naming_rule.public_const_all_upper.severity = warning
dotnet_naming_rule.public_const_all_upper.symbols = public_constants
dotnet_naming_rule.public_const_all_upper.style = all_upper

dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_static_readonly.required_modifiers = static,readonly
dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
dotnet_naming_symbols.public_static_readonly.required_modifiers = static, readonly
dotnet_naming_symbols.public_static_readonly.applicable_kinds = field
dotnet_naming_rule.public_static_readonly_all_upper.severity = warning
dotnet_naming_rule.public_static_readonly_all_upper.symbols = public_static_readonly
Expand Down Expand Up @@ -126,7 +126,7 @@ csharp_style_var_elsewhere = true:silent

#Style - modifiers
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
csharp_preferred_modifier_order = public,private,protected,internal,new,abstract,virtual,sealed,override,static,readonly,extern,unsafe,volatile,async:warning
csharp_preferred_modifier_order = public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:warning

#Style - parentheses
# Skipped because roslyn cannot separate +-*/ with << >>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<EmbeddedResource Include="Resources\**\*"/>
</ItemGroup>
<ItemGroup>
<EditorConfgFiles Include=".editorconfig" />
<EditorConfgFiles Include=".globalconfig" />
<EditorConfgFiles Include=".editorconfig"/>
<EditorConfgFiles Include=".globalconfig"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public TestSceneAllSlides()
Add(chevronPool = new DrawablePool<SlideChevron>(62));
Add(fanChevrons = new SlideFanChevrons());

Add(new SentakkiRing()
Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
Expand All @@ -49,7 +49,7 @@ public TestSceneAllSlides()
RefreshSlide();
});

Add(nodes = new Container()
Add(nodes = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand All @@ -68,6 +68,7 @@ protected void RefreshSlide()
{
slide.Path = CreatePattern();
nodes.Clear();

foreach (var node in slide.Path.SlideSegments.SelectMany(s => s.ControlPoints))
{
nodes.Add(new CircularContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ public partial class TestSceneFanSlide : OsuTestScene
protected int StartPath;
protected int EndPath;

private SentakkiRing ring;

[Cached]
private readonly SlideFanChevrons fanChevrons;

private SlideVisual slide;
private readonly SlideVisual slide;

public TestSceneFanSlide()
{
Add(fanChevrons = new SlideFanChevrons());

Add(ring = new SentakkiRing()
Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public abstract partial class TestSceneSlide : OsuTestScene
[Cached]
private readonly SlideFanChevrons fanChevrons;

public TestSceneSlide()
protected TestSceneSlide()
{
Add(chevronPool = new DrawablePool<SlideChevron>(62));
Add(fanChevrons = new SlideFanChevrons());

Add(new SentakkiRing()
Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
Expand Down Expand Up @@ -76,7 +76,7 @@ public TestSceneSlide()
AddStep("Perform exit animation", () => slide.PerformExitAnimation(1000));
AddWaitStep("Wait for transforms", 5);

Add(nodes = new Container()
Add(nodes = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand All @@ -95,6 +95,7 @@ protected void RefreshSlide()
{
slide.Path = CreatePattern();
nodes.Clear();

foreach (var node in slide.Path.SlideSegments.SelectMany(s => s.ControlPoints))
{
nodes.Add(new CircularContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void testSingle(bool auto = false)
NoteColour = Color4.OrangeRed,
};

circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

Add(new DrawableTap(circle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void testSingle(double duration, bool auto = false)
EndTime = Time.Current + 1000 + duration,
};

circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

Add(new DrawableHold(circle)
{
Expand Down
11 changes: 7 additions & 4 deletions osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class TestSceneSlideFan : OsuTestScene
public TestSceneSlideFan()
{
base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo));
Add(new SentakkiRing()
Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE),
Expand All @@ -53,15 +53,16 @@ private void testSingle(double duration, bool auto = false)
//Break = true,
SlideInfoList = new List<SlideBodyInfo>
{
new SlideBodyInfo {
SlidePathParts = new[] {new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false)},
new SlideBodyInfo
{
SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Fan, 4, false) },
Duration = 1000,
},
},
StartTime = Time.Current + 1000,
};

slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

DrawableSlide dSlide;

Expand All @@ -74,8 +75,10 @@ private void testSingle(double duration, bool auto = false)
});

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
nested2.Auto = auto;
}
}
}
}
42 changes: 28 additions & 14 deletions osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public partial class TestSceneSlideNote : OsuTestScene
public TestSceneSlideNote()
{
base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo));
Add(new SentakkiRing()
Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE),
Expand Down Expand Up @@ -66,23 +66,26 @@ private void testSingle(double duration, bool auto = false)
//Break = true,
SlideInfoList = new List<SlideBodyInfo>
{
new SlideBodyInfo {
SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Circle, 0, false)},
new SlideBodyInfo
{
SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Circle, 0, false) },
Duration = 1000,
},
new SlideBodyInfo {
SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Straight, 4, false)},
new SlideBodyInfo
{
SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Straight, 4, false) },
Duration = 1500,
},
new SlideBodyInfo {
SlidePathParts = new []{new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false)},
new SlideBodyInfo
{
SlidePathParts = new[] { new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false) },
Duration = 2000,
}
},
StartTime = Time.Current + 1000,
};

slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

DrawableSlide dSlide;

Expand All @@ -95,8 +98,10 @@ private void testSingle(double duration, bool auto = false)
});

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
nested2.Auto = auto;
}
}

private void testChain(double duration, bool auto = false)
Expand All @@ -106,8 +111,10 @@ private void testChain(double duration, bool auto = false)
//Break = true,
SlideInfoList = new List<SlideBodyInfo>
{
new SlideBodyInfo {
SlidePathParts = new []{
new SlideBodyInfo
{
SlidePathParts = new[]
{
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
Expand All @@ -119,7 +126,7 @@ private void testChain(double duration, bool auto = false)
StartTime = Time.Current + 1000,
};

slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

DrawableSlide dSlide;

Expand All @@ -132,18 +139,23 @@ private void testChain(double duration, bool auto = false)
});

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
nested2.Auto = auto;
}
}

private void testChainWithFan(double duration, bool auto = false)
{
var slide = new Slide
{
//Break = true,
SlideInfoList = new List<SlideBodyInfo>
{
new SlideBodyInfo {
SlidePathParts = new []{
new SlideBodyInfo
{
SlidePathParts = new[]
{
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
new SlideBodyPart(SlidePaths.PathShapes.Cup, 2, false),
Expand All @@ -156,7 +168,7 @@ private void testChainWithFan(double duration, bool auto = false)
StartTime = Time.Current + 1000,
};

slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
slide.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

DrawableSlide dSlide;

Expand All @@ -169,8 +181,10 @@ private void testChainWithFan(double duration, bool auto = false)
});

foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects)
{
foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects)
nested2.Auto = auto;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void testSingle(bool auto = false)
StartTime = Time.Current + 1000,
};

circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

Add(new DrawableTap(circle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ private void testSingle(bool auto = false)
{
StartTime = Time.Current + 1000,
Duration = 5000,
Samples = new List<HitSampleInfo>{
Samples = new List<HitSampleInfo>
{
new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
},
};

circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

Add(new DrawableTouchHold(circle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class TestSceneTouchNote : OsuTestScene
public TestSceneTouchNote()
{
base.Content.Add(content = new SentakkiInputManager(new SentakkiRuleset().RulesetInfo));
base.Content.Add(new SentakkiRing()
base.Content.Add(new SentakkiRing
{
RelativeSizeAxes = Axes.None,
Size = new Vector2(SentakkiPlayfield.RINGSIZE)
Expand All @@ -46,7 +46,7 @@ private void testAllPositions(bool auto = false)
Position = position,
};

circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { });
circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

Add(new DrawableTouch(circle)
{
Expand Down
Loading

0 comments on commit 806fae1

Please sign in to comment.