Restructured the project save data folder layout when the engine starts. The XMLData class now creates directories if they are missing. Individual classes no longer need to check if a path is valid before saving. Filenames are now automatically generated and no longer assigned by developers. This change has been made across all classes that are savable which required some changing of the Save() method arguments.
32 lines
952 B
C#
32 lines
952 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace MudEngine.Core.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// Public API for classes that need to be saved during runtime.
|
|
/// </summary>
|
|
public interface ISavable
|
|
{
|
|
/// <summary>
|
|
/// Objects filename.
|
|
/// </summary>
|
|
String Filename { get; }
|
|
|
|
/// <summary>
|
|
/// Save method for dumping the object to physical file.
|
|
/// </summary>
|
|
/// <param name="path"></param>
|
|
Boolean Save();
|
|
|
|
Boolean Save(Boolean ignoreFileWrite);
|
|
|
|
/// <summary>
|
|
/// Load method for retrieving saved data from file.
|
|
/// </summary>
|
|
/// <param name="filename">Filename is required complete with Path since this object does not exist yet (can not get filename from non-existing object)</param>
|
|
void Load(String filename);
|
|
}
|
|
}
|