diff --git a/SpriteLibrary/SpriteInfo.cs b/SpriteLibrary/SpriteInfo.cs index 1e3754a..75fe6bd 100644 --- a/SpriteLibrary/SpriteInfo.cs +++ b/SpriteLibrary/SpriteInfo.cs @@ -49,6 +49,22 @@ namespace SpriteLibrary return SpriteDatabase.CloneByXMLSerializing(this); } + /// + /// Update the current SpriteInfo class such that it is identical to the class you are copying from. + /// + /// A spriteInfo class + public void CopyFrom(SpriteInfo toCopyFrom) + { + if (toCopyFrom == null) return; + SpriteName = toCopyFrom.SpriteName; + ViewPercent = toCopyFrom.ViewPercent; + Animations.Clear(); + foreach(AnimationInfo AI in toCopyFrom.Animations) + { + Animations.Add(AI.Clone()); + } + } + public Sprite CreateSprite(SpriteController ControllerToUse, SpriteDatabase TheDatabaseToUse) { Sprite DestSprite = null;