Add a save function
This commit is contained in:
parent
84e15883fd
commit
7d1883b765
@ -40,6 +40,22 @@ namespace SpriteLibrary
|
||||
LoadSpriteInfo();
|
||||
}
|
||||
|
||||
internal void Save()
|
||||
{
|
||||
if(!DoesResourceExist(Filename))
|
||||
{
|
||||
//we will try to save it as a file
|
||||
try
|
||||
{
|
||||
WriteToXmlFile<List<SpriteInfo>>(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;
|
||||
|
Loading…
Reference in New Issue
Block a user