Rename things in PulpFormation

This commit is contained in:
ekrctb 2020-12-08 10:32:46 +09:00
parent 3cbdaf5960
commit 4da6717d0e
3 changed files with 28 additions and 27 deletions

View File

@ -9,8 +9,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
{
public BananaPulpFormation()
{
Add(new Vector2(0, -0.3f), new Vector2(SMALL_PULP));
Add(new Vector2(0, 0.05f), new Vector2(LARGE_PULP_4 * 0.8f, LARGE_PULP_4 * 2.5f));
AddPulp(new Vector2(0, -0.3f), new Vector2(SMALL_PULP));
AddPulp(new Vector2(0, 0.05f), new Vector2(LARGE_PULP_4 * 0.8f, LARGE_PULP_4 * 2.5f));
}
}
}

View File

@ -25,33 +25,33 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
switch (visualRepresentation.NewValue)
{
case FruitVisualRepresentation.Pear:
Add(new Vector2(0, -0.33f), new Vector2(SMALL_PULP));
Add(PositionAt(60, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
Add(PositionAt(180, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
Add(PositionAt(300, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(new Vector2(0, -0.33f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(60, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(180, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(300, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
break;
case FruitVisualRepresentation.Grape:
Add(new Vector2(0, -0.25f), new Vector2(SMALL_PULP));
Add(PositionAt(0, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
Add(PositionAt(120, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
Add(PositionAt(240, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(new Vector2(0, -0.25f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(0, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(120, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
AddPulp(PositionAt(240, DISTANCE_FROM_CENTRE_3), new Vector2(LARGE_PULP_3));
break;
case FruitVisualRepresentation.Pineapple:
Add(new Vector2(0, -0.3f), new Vector2(SMALL_PULP));
Add(PositionAt(45, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(135, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(225, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(315, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(new Vector2(0, -0.3f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(45, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(135, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(225, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(315, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
break;
case FruitVisualRepresentation.Raspberry:
Add(new Vector2(0, -0.34f), new Vector2(SMALL_PULP));
Add(PositionAt(0, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(90, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(180, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
Add(PositionAt(270, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(new Vector2(0, -0.34f), new Vector2(SMALL_PULP));
AddPulp(PositionAt(0, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(90, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(180, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
AddPulp(PositionAt(270, DISTANCE_FROM_CENTRE_4), new Vector2(LARGE_PULP_4));
break;
}
}

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
protected const float SMALL_PULP = LARGE_PULP_3 / 2;
private int numPulps;
private int pulpsInUse;
protected PulpFormation()
{
@ -35,21 +35,22 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
protected void Clear()
{
for (; numPulps > 0; numPulps--)
InternalChildren[numPulps - 1].Alpha = 0;
for (int i = 0; i < pulpsInUse; i++)
InternalChildren[i].Alpha = 0;
pulpsInUse = 0;
}
protected void Add(Vector2 position, Vector2 size)
protected void AddPulp(Vector2 position, Vector2 size)
{
if (numPulps == InternalChildren.Count)
if (pulpsInUse == InternalChildren.Count)
AddInternal(new Pulp { AccentColour = { BindTarget = AccentColour } });
var pulp = InternalChildren[numPulps];
var pulp = InternalChildren[pulpsInUse];
pulp.Position = position;
pulp.Size = size;
pulp.Alpha = 1;
numPulps++;
pulpsInUse++;
}
}
}