diff --git a/SpriteLibrary/SpriteDatabase.cs b/SpriteLibrary/SpriteDatabase.cs index 90b0bc3..5e3475f 100644 --- a/SpriteLibrary/SpriteDatabase.cs +++ b/SpriteLibrary/SpriteDatabase.cs @@ -40,6 +40,22 @@ namespace SpriteLibrary LoadSpriteInfo(); } + internal void Save() + { + if(!DoesResourceExist(Filename)) + { + //we will try to save it as a file + try + { + WriteToXmlFile>(Filename, SpriteInfoList); + } + catch (Exception e) + { + throw new Exception("SpriteDatabase failed to save: Filename:" + Filename +"\n" + "ERROR: " + e.ToString(), e); + } + } + } + public void SetSnapGridSize(Size GridSize) { if (GridSize.Width <= 0) return;