Animation.cs - Removed index operator

This commit is contained in:
miku-666
2023-05-12 17:22:11 +02:00
parent ea8484a6d9
commit 11d56af848
2 changed files with 4 additions and 8 deletions

View File

@@ -16,8 +16,6 @@ namespace PckStudio.Forms.Editor
public int TextureCount => textures.Count;
public Frame this[int frameIndex] => frames[frameIndex];
public bool Interpolate { get; set; } = false;
private readonly List<Image> textures;

View File

@@ -27,8 +27,6 @@ namespace PckStudio.Forms.Editor
cts.Cancel();
}
public Animation.Frame GetCurrentFrame() => _animation[currentAnimationFrameIndex];
public void SelectFrame(Animation animation, int index)
{
if (IsPlaying)
@@ -67,14 +65,14 @@ namespace PckStudio.Forms.Editor
if (currentAnimationFrameIndex + 1 >= _animation.FrameCount)
{
nextFrame = _animation[0];
nextFrame = _animation.GetFrame(0);
}
else
{
nextFrame = _animation[currentAnimationFrameIndex + 1];
nextFrame = _animation.GetFrame(currentAnimationFrameIndex + 1);
}
currentFrame = _animation[currentAnimationFrameIndex++];
currentFrame = _animation.GetFrame(currentAnimationFrameIndex++);
if (_animation.Interpolate)
{
await InterpolateFrame(currentFrame, nextFrame);
@@ -103,7 +101,7 @@ namespace PckStudio.Forms.Editor
private Animation.Frame SetAnimationFrame(int frameIndex)
{
var frame = _animation[frameIndex];
var frame = _animation.GetFrame(frameIndex);
SetAnimationFrame(frame);
return frame;
}