2020-04-29 01:56:34 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
using Svelto.ECS.Serialization;
|
|
|
|
|
|
|
|
|
|
using GamecraftModdingAPI.Utility;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Persistence
|
|
|
|
|
{
|
2020-04-29 02:59:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC).
|
|
|
|
|
/// </summary>
|
2020-04-29 01:56:34 +00:00
|
|
|
|
public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine
|
|
|
|
|
{
|
2020-07-10 22:30:58 +00:00
|
|
|
|
/// <summary>
|
2020-04-29 02:59:36 +00:00
|
|
|
|
/// Serialize the entities.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Whether serialization was successful.</returns>
|
|
|
|
|
/// <param name="serializationData">Serialized data to write to (writes to GameSave.GC).</param>
|
|
|
|
|
/// <param name="entitiesDB">Entities db for the game.</param>
|
|
|
|
|
/// <param name="entitySerializer">Entity serializer with support for single-entity serialization.</param>
|
2020-04-29 01:56:34 +00:00
|
|
|
|
bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer);
|
|
|
|
|
|
2020-04-29 02:59:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deserialize the entities.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Whether deserialization was successful.</returns>
|
|
|
|
|
/// <param name="serializationData">Serialized data to read from (read from GameSave.GC).</param>
|
|
|
|
|
/// <param name="entitySerializer">Entity serializer with support for single-entity deserialization.</param>
|
2020-04-29 01:56:34 +00:00
|
|
|
|
bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer);
|
|
|
|
|
}
|
|
|
|
|
}
|