Cloning infrastructure and breaking up spriteInfo to be able to hold multiple animations for one sprite
This commit is contained in:
@ -7,15 +7,39 @@ using System.Drawing;
|
||||
|
||||
namespace SpriteLibrary
|
||||
{
|
||||
internal class SpriteInfo
|
||||
internal class AnimationInfo
|
||||
{
|
||||
public string SpriteName = "";
|
||||
public Point StartPoint = new Point(-1, -1);
|
||||
public string ImageName = "";
|
||||
public int Width = -1;
|
||||
public int Height = -1;
|
||||
public int AnimSpeed = 200;
|
||||
public int NumAnimations = 1;
|
||||
public int NumFrames = 1;
|
||||
public int ViewPercent = 100; //The percent size of the sprite. 100 is full. 50 is half-size
|
||||
|
||||
/// <summary>
|
||||
/// A generic cloning method that works when everything is public
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AnimationInfo Clone()
|
||||
{
|
||||
return SpriteDatabase.CloneByXMLSerializing<AnimationInfo>(this);
|
||||
}
|
||||
}
|
||||
|
||||
internal class SpriteInfo
|
||||
{
|
||||
public string SpriteName = "";
|
||||
public int ViewPercent = 100; //The percent size of the sprite. 100 is full. 50 is half-size
|
||||
public List<AnimationInfo> Animations = new List<AnimationInfo>();
|
||||
|
||||
/// <summary>
|
||||
/// A generic cloning method that works when everything is public
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public SpriteInfo Clone()
|
||||
{
|
||||
return SpriteDatabase.CloneByXMLSerializing<SpriteInfo>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user