Rename grid creation method + parameter

This commit is contained in:
smoogipoo 2019-10-11 15:41:40 +09:00
parent 5f0cd356d7
commit 9ecec806c2
2 changed files with 12 additions and 12 deletions

View File

@ -138,63 +138,63 @@ public TestBeatSnapGrid(HitObject hitObject, Vector2 centrePosition)
{
}
protected override void CreateGrid(Vector2 startPosition)
protected override void CreateContent(Vector2 centrePosition)
{
AddInternal(new Circle
{
Origin = Anchor.Centre,
Size = new Vector2(5),
Position = startPosition
Position = centrePosition
});
int beatIndex = 0;
for (float s = startPosition.X + DistanceSpacing; s <= DrawWidth; s += DistanceSpacing, beatIndex++)
for (float s = centrePosition.X + DistanceSpacing; s <= DrawWidth; s += DistanceSpacing, beatIndex++)
{
AddInternal(new Circle
{
Origin = Anchor.Centre,
Size = new Vector2(5, 10),
Position = new Vector2(s, startPosition.Y),
Position = new Vector2(s, centrePosition.Y),
Colour = GetColourForBeatIndex(beatIndex)
});
}
beatIndex = 0;
for (float s = startPosition.X - DistanceSpacing; s >= 0; s -= DistanceSpacing, beatIndex++)
for (float s = centrePosition.X - DistanceSpacing; s >= 0; s -= DistanceSpacing, beatIndex++)
{
AddInternal(new Circle
{
Origin = Anchor.Centre,
Size = new Vector2(5, 10),
Position = new Vector2(s, startPosition.Y),
Position = new Vector2(s, centrePosition.Y),
Colour = GetColourForBeatIndex(beatIndex)
});
}
beatIndex = 0;
for (float s = startPosition.Y + DistanceSpacing; s <= DrawHeight; s += DistanceSpacing, beatIndex++)
for (float s = centrePosition.Y + DistanceSpacing; s <= DrawHeight; s += DistanceSpacing, beatIndex++)
{
AddInternal(new Circle
{
Origin = Anchor.Centre,
Size = new Vector2(10, 5),
Position = new Vector2(startPosition.X, s),
Position = new Vector2(centrePosition.X, s),
Colour = GetColourForBeatIndex(beatIndex)
});
}
beatIndex = 0;
for (float s = startPosition.Y - DistanceSpacing; s >= 0; s -= DistanceSpacing, beatIndex++)
for (float s = centrePosition.Y - DistanceSpacing; s >= 0; s -= DistanceSpacing, beatIndex++)
{
AddInternal(new Circle
{
Origin = Anchor.Centre,
Size = new Vector2(10, 5),
Position = new Vector2(startPosition.X, s),
Position = new Vector2(centrePosition.X, s),
Colour = GetColourForBeatIndex(beatIndex)
});
}

View File

@ -92,7 +92,7 @@ protected override void Update()
if (!gridCache.IsValid)
{
ClearInternal();
CreateGrid(StartPosition);
CreateContent(CentrePosition);
gridCache.Validate();
}
}
@ -100,7 +100,7 @@ protected override void Update()
/// <summary>
/// Creates the content which visualises the grid ticks.
/// </summary>
protected abstract void CreateGrid(Vector2 startPosition);
protected abstract void CreateContent(Vector2 centrePosition);
/// <summary>
/// Retrieves the velocity of gameplay at a point in time in pixels per millisecond.