Restructured Solution Layout

Moved several enums and helper classes into the QURO library for flexibility and potential reuse.

Also solved desync in animations by making AnimatedSprites reset their timer every time a new animation is loaded.
This commit is contained in:
quinnvoker
2018-11-17 20:54:01 -08:00
parent fb85769677
commit 9a25f068fc
9 changed files with 40 additions and 13 deletions
+36
View File
@@ -0,0 +1,36 @@
using Microsoft.Xna.Framework;
namespace QURO.AnimationLibrary
{
public class Animation
{
public string Name { get; set; }
public bool IsLooping { get; set; }
public Frame[] Frames { get; set; }
public bool IsStillImage => Frames.Length <= 1;
public Animation() { }
public Animation(string name, Frame[] frames, bool loop)
{
Name = name;
Frames = frames;
IsLooping = loop;
}
public Animation(string name, Rectangle[] sourceRects, float delay, bool loop)
{
Name = name;
Frames = new Frame[sourceRects.Length];
for(int index = 0; index < sourceRects.Length; index++)
{
Frames[index] = new Frame(sourceRects[index], delay);
}
IsLooping = loop;
}
}
}