Remove SpecialColumnPosition for now

This needs to be re-implemented in the future, perhaps in a way that allows it to be dynamically changed.
This commit is contained in:
smoogipoo 2018-01-22 16:18:39 +09:00
parent 8a8b3f25e7
commit 68a6323168
5 changed files with 13 additions and 60 deletions

View File

@ -33,12 +33,10 @@ public TestCaseManiaPlayfield()
{
var rng = new Random(1337);
AddStep("1 column", () => createPlayfield(1, SpecialColumnPosition.Normal));
AddStep("4 columns", () => createPlayfield(4, SpecialColumnPosition.Normal));
AddStep("Left special style", () => createPlayfield(4, SpecialColumnPosition.Left));
AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right));
AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal));
AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal));
AddStep("1 column", () => createPlayfield(1));
AddStep("4 columns", () => createPlayfield(4));
AddStep("5 columns", () => createPlayfield(5));
AddStep("8 columns", () => createPlayfield(8));
AddStep("4 + 4 columns", () =>
{
var stages = new List<StageDefinition>
@ -46,7 +44,7 @@ public TestCaseManiaPlayfield()
new StageDefinition { Columns = 4 },
new StageDefinition { Columns = 4 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
createPlayfield(stages);
});
AddStep("2 + 4 + 2 columns", () =>
@ -57,7 +55,7 @@ public TestCaseManiaPlayfield()
new StageDefinition { Columns = 4 },
new StageDefinition { Columns = 2 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
createPlayfield(stages);
});
AddStep("1 + 8 + 1 columns", () =>
@ -68,12 +66,10 @@ public TestCaseManiaPlayfield()
new StageDefinition { Columns = 8 },
new StageDefinition { Columns = 1 },
};
createPlayfield(stages, SpecialColumnPosition.Normal);
createPlayfield(stages);
});
AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left));
AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right));
AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true));
AddStep("Reversed", () => createPlayfield(4, true));
AddStep("Notes with input", () => createPlayfieldWithNotes());
AddStep("Notes with input (reversed)", () => createPlayfieldWithNotes(true));
@ -82,7 +78,7 @@ public TestCaseManiaPlayfield()
AddStep("Hit explosion", () =>
{
var playfield = createPlayfield(4, SpecialColumnPosition.Normal);
var playfield = createPlayfield(4);
int col = rng.Next(0, 4);
@ -102,17 +98,17 @@ private void load(RulesetStore rulesets)
maniaRuleset = rulesets.GetRuleset(3);
}
private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false)
private ManiaPlayfield createPlayfield(int cols, bool inverted = false)
{
var stages = new List<StageDefinition>
{
new StageDefinition { Columns = cols },
};
return createPlayfield(stages, specialPos, inverted);
return createPlayfield(stages, inverted);
}
private ManiaPlayfield createPlayfield(List<StageDefinition> stages, SpecialColumnPosition specialPos, bool inverted = false)
private ManiaPlayfield createPlayfield(List<StageDefinition> stages, bool inverted = false)
{
Clear();
@ -127,7 +123,6 @@ private ManiaPlayfield createPlayfield(List<StageDefinition> stages, SpecialColu
Origin = Anchor.Centre,
});
playfield.SpecialColumnPosition.Value = specialPos;
playfield.Inverted.Value = inverted;
return playfield;

View File

@ -22,11 +22,6 @@ public class ManiaPlayfield : ScrollingPlayfield
/// </summary>
public readonly Bindable<bool> Inverted = new Bindable<bool>(true);
/// <summary>
/// The style to use for the special column.
/// </summary>
public Bindable<SpecialColumnPosition> SpecialColumnPosition = new Bindable<SpecialColumnPosition>();
public List<Column> Columns => stages.SelectMany(x => x.Columns).ToList();
private readonly List<ManiaStage> stages = new List<ManiaStage>();
@ -54,7 +49,6 @@ public ManiaPlayfield(List<StageDefinition> stageDefinitions)
for (int i = 0; i < stageDefinitions.Count; i++)
{
var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction);
newStage.SpecialColumnPosition.BindTo(SpecialColumnPosition);
newStage.VisibleTimeRange.BindTo(VisibleTimeRange);
newStage.Inverted.BindTo(Inverted);

View File

@ -33,8 +33,6 @@ internal class ManiaStage : ScrollingPlayfield
/// </summary>
public readonly Bindable<bool> Inverted = new Bindable<bool>(true);
public readonly Bindable<SpecialColumnPosition> SpecialColumnPosition = new Bindable<SpecialColumnPosition>();
public IReadOnlyList<Column> Columns => columnFlow.Children;
private readonly FillFlowContainer<Column> columnFlow;
@ -167,19 +165,7 @@ public void AddColumn(Column c)
/// </summary>
/// <param name="column">The 0-based column index.</param>
/// <returns>Whether the column is a special column.</returns>
private bool isSpecialColumn(int column)
{
switch (SpecialColumnPosition.Value)
{
default:
case UI.SpecialColumnPosition.Normal:
return definition.Columns % 2 == 1 && column == definition.Columns / 2;
case UI.SpecialColumnPosition.Left:
return column == 0;
case UI.SpecialColumnPosition.Right:
return column == definition.Columns - 1;
}
}
private bool isSpecialColumn(int column) => definition.Columns % 2 == 1 && column == definition.Columns / 2;
public override void Add(DrawableHitObject h)
{

View File

@ -1,21 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Rulesets.Mania.UI
{
public enum SpecialColumnPosition
{
/// <summary>
/// The special column will lie in the center of the columns.
/// </summary>
Normal,
/// <summary>
/// The special column will lie to the left of the columns.
/// </summary>
Left,
/// <summary>
/// The special column will lie to the right of the columns.
/// </summary>
Right
}
}

View File

@ -122,7 +122,6 @@
<Compile Include="UI\ManiaPlayfield.cs" />
<Compile Include="ManiaRuleset.cs" />
<Compile Include="Mods\ManiaModNoFail.cs" />
<Compile Include="UI\SpecialColumnPosition.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />