TechbloxModdingAPI/GamecraftModdingAPI/Persistence/IEntitySerializer.cs

39 lines
1.6 KiB
C#
Raw Normal View History

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>
public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine
{
2020-04-29 02:59:36 +00:00
/// <summary>
/// The entity factory used for creating entities and entity components.
/// </summary>
/// <value>The entity factory.</value>
IEntityFactory EntityFactory { set; }
2020-04-29 02:59:36 +00:00
/// <summary>
/// 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>
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>
bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer);
}
}