Let fruits know what index they are in the beatmap to draw a visual representation

This commit is contained in:
Dean Herbert 2018-01-03 16:31:57 +09:00
parent 31865b4d96
commit 02131d75d4
2 changed files with 15 additions and 5 deletions

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
if (beatmap.ComboColors.Count == 0)
return;
int comboIndex = 0;
int index = 0;
int colourIndex = 0;
CatchHitObject lastObj = null;
@ -31,12 +31,10 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
if (obj.NewCombo)
{
if (lastObj != null) lastObj.LastInCombo = true;
comboIndex = 0;
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
}
obj.ComboIndex = comboIndex++;
obj.IndexInBeatmap = index++;
obj.ComboColour = beatmap.ComboColors[colourIndex];
lastObj = obj;

View File

@ -16,7 +16,10 @@ namespace osu.Game.Rulesets.Catch.Objects
public float X { get; set; }
public Color4 ComboColour { get; set; } = Color4.Gray;
public int ComboIndex { get; set; }
public int IndexInBeatmap { get; set; }
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4);
public virtual bool NewCombo { get; set; }
@ -44,4 +47,13 @@ namespace osu.Game.Rulesets.Catch.Objects
Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5;
}
}
public enum FruitVisualRepresentation
{
Pear,
Grape,
Apple,
Orange,
Banana // banananananannaanana
}
}