-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edcaa1a
commit bbc56a6
Showing
7 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
namespace Chonks { | ||
public interface ISaveInterpreter { | ||
/// <summary> | ||
/// Processes chunks from a save file. | ||
/// </summary> | ||
/// <param name="chunks">The chunks.</param> | ||
void ProcessChunks(SaveChunk[] chunks); | ||
|
||
/// <summary> | ||
/// Applies any modifications made to the chunks. | ||
/// </summary> | ||
/// <param name="chunks">The chunks.</param> | ||
/// <returns></returns> | ||
SaveChunk[] ApplyModifications(SaveChunk[] chunks); | ||
|
||
/// <summary> | ||
/// Determines whether this instance is dirty. | ||
/// </summary> | ||
/// <returns> | ||
/// <c>true</c> if this instance is dirty; otherwise, <c>false</c>. | ||
/// </returns> | ||
bool IsDirty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
namespace Chonks { | ||
public interface ISaveManager { | ||
/// <summary> | ||
/// Makes a new snapshot. | ||
/// </summary> | ||
void MakeSnapshot(); | ||
|
||
/// <summary> | ||
/// Applies the most recently created snapshot to a container. | ||
/// </summary> | ||
/// <param name="container">The container.</param> | ||
void ApplySnapshot(SaveContainer container); | ||
|
||
/// <summary> | ||
/// Loads a snapshot from a container. | ||
/// </summary> | ||
/// <param name="container">The container.</param> | ||
void LoadSnapshot(SaveContainer container); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
using System.Collections.Generic; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Chonks { | ||
[Serializable] | ||
public class SaveState { | ||
/// <summary> | ||
/// Gets or sets the name of the chunk. | ||
/// </summary> | ||
/// <value> | ||
/// The name of the chunk. | ||
/// </value> | ||
public string ChunkName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the data. | ||
/// </summary> | ||
/// <value> | ||
/// The data. | ||
/// </value> | ||
public object Data { get; set; } | ||
} | ||
|
||
public interface ISaveStore { | ||
/// <summary> | ||
/// Gets the store identifier. | ||
/// </summary> | ||
/// <returns></returns> | ||
string GetStoreIdentifier(); | ||
|
||
/// <summary> | ||
/// Gets the save states for each chunk. | ||
/// </summary> | ||
/// <returns></returns> | ||
List<SaveState> GetSaveStates(); | ||
void LoadChunkData(string chunkName, ChunkDataSegment data); | ||
/// <summary> | ||
/// Loads the chunk data. | ||
/// </summary> | ||
/// <param name="chunkName">Name of the chunk.</param> | ||
/// <param name="data">The data.</param> | ||
/// <param name="onAllChunksLoadedCallback">The callback (if any) to call when all chunks have been loaded. Note: this is not called if the store is recieving chunk data outside of a snapshot creation.</param> | ||
void LoadChunkData(string chunkName, ChunkDataSegment data, out Action onAllChunksLoadedCallback); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters