From e947e4656642b4d1c62a4fefb16cdece398ff781 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 11:41:52 +0900 Subject: [PATCH] fix : 1. Add space before {, before Duration, and after 1000 2. How about just ManiaStage? 3. This is really just Columns.Count, you're not saving much with this extra variable here. --- .../Tests/TestCaseManiaHitObjects.cs | 2 +- osu.Game.Rulesets.Mania/UI/Column.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 24 +++++++++---------- .../UI/{ManiaColumnStage.cs => ManiaStage.cs} | 11 ++++----- .../osu.Game.Rulesets.Mania.csproj | 2 +- 5 files changed, 20 insertions(+), 23 deletions(-) rename osu.Game.Rulesets.Mania/UI/{ManiaColumnStage.cs => ManiaStage.cs} (93%) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 4a26b1510c..0e6d40dc67 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote{Duration = 1000}, ManiaAction.Key1) + new DrawableHoldNote(new HoldNote { Duration = 1000 } , ManiaAction.Key1) { Y = 5000, Height = 1000, diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 97600632f1..c2dd86d35d 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Hit target + hit objects", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = ManiaColumnStage.HIT_TARGET_POSITION }, + Padding = new MarginPadding { Top = ManiaStage.HIT_TARGET_POSITION }, Children = new Drawable[] { new Container @@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key", RelativeSizeAxes = Axes.X, - Height = ManiaColumnStage.HIT_TARGET_POSITION, + Height = ManiaStage.HIT_TARGET_POSITION, Children = new Drawable[] { new Box diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3125a01528..8f4d5b04b5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// list mania column stages /// - private readonly FillFlowContainer listColumnStages; + private readonly FillFlowContainer Stages; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. @@ -37,17 +37,17 @@ namespace osu.Game.Rulesets.Mania.UI /// public SpecialColumnPosition SpecialColumnPosition { - get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + get => Stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; set { - foreach (var singleStage in listColumnStages) + foreach (var singleStage in Stages) { singleStage.SpecialColumnPosition = value; } } } - public List Columns => listColumnStages.SelectMany(x => x.Columns).ToList(); + public List Columns => Stages.SelectMany(x => x.Columns).ToList(); private readonly int columnCount; @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.UI InternalChildren = new Drawable[] { - listColumnStages = new FillFlowContainer + Stages = new FillFlowContainer { Name="Stages", Direction = FillDirection.Horizontal, @@ -78,10 +78,10 @@ namespace osu.Game.Rulesets.Mania.UI foreach (var stage in stages) { - var drawableStage = new ManiaColumnStage(stage.Columns); + var drawableStage = new ManiaStage(); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - listColumnStages.Add(drawableStage); + Stages.Add(drawableStage); AddNested(drawableStage); for (int i = 0; i < stage.Columns; i++) @@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.UI { Scale = new Vector2(1, newValue ? -1 : 1); - foreach (var single in listColumnStages) + foreach (var single in Stages) { single.Judgements.Scale = Scale; } @@ -124,18 +124,18 @@ namespace osu.Game.Rulesets.Mania.UI public void Add(BarLine barline) { - foreach (var single in listColumnStages) + foreach (var single in Stages) { single.HitObjects.Add(new DrawableBarLine(barline)); } } - private ManiaColumnStage getFallDownControlContainerByActualColumn(int actualColumn) + private ManiaStage getFallDownControlContainerByActualColumn(int actualColumn) { int sum = 0; - foreach (var single in listColumnStages) + foreach (var single in Stages) { - sum = sum + single.ColumnCount; + sum = sum + single.Columns.Count(); if (sum > actualColumn) { return single; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs similarity index 93% rename from osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs rename to osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 99f171947c..b2f6460914 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// A collection of s. /// - internal class ManiaColumnStage : ScrollingPlayfield + internal class ManiaStage : ScrollingPlayfield { public const float HIT_TARGET_POSITION = 50; @@ -53,12 +53,9 @@ namespace osu.Game.Rulesets.Mania.UI private List normalColumnColours = new List(); private Color4 specialColumnColour; - public readonly int ColumnCount; - - public ManiaColumnStage(int columnCount) + public ManiaStage() : base(ScrollingDirection.Up) { - ColumnCount = columnCount; Name = "Playfield elements"; Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; @@ -142,11 +139,11 @@ namespace osu.Game.Rulesets.Mania.UI { default: case SpecialColumnPosition.Normal: - return ColumnCount % 2 == 1 && column == ColumnCount / 2; + return columns.Count % 2 == 1 && column == columns.Count / 2; case SpecialColumnPosition.Left: return column == 0; case SpecialColumnPosition.Right: - return column == ColumnCount - 1; + return column == columns.Count - 1; } } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index c81a6bb2ea..ae29484161 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -115,7 +115,7 @@ - +