A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6KB

  1. using System;
  2. using Svelto.ECS;
  3. using Svelto.ECS.Serialization;
  4. using GamecraftModdingAPI.Utility;
  5. namespace GamecraftModdingAPI.Persistence
  6. {
  7. /// <summary>
  8. /// Entity serializer and deserializer interface for storing and retrieving data in a Gamecraft save file (GameSave.GC).
  9. /// </summary>
  10. public interface IEntitySerializer : IDeserializationFactory, IQueryingEntitiesEngine
  11. {
  12. /// <summary>
  13. /// The entity factory used for creating entities and entity components.
  14. /// </summary>
  15. /// <value>The entity factory.</value>
  16. IEntityFactory EntityFactory { set; }
  17. /// <summary>
  18. /// Serialize the entities.
  19. /// </summary>
  20. /// <returns>Whether serialization was successful.</returns>
  21. /// <param name="serializationData">Serialized data to write to (writes to GameSave.GC).</param>
  22. /// <param name="entitiesDB">Entities db for the game.</param>
  23. /// <param name="entitySerializer">Entity serializer with support for single-entity serialization.</param>
  24. bool Serialize(ref ISerializationData serializationData, EntitiesDB entitiesDB, IEntitySerialization entitySerializer);
  25. /// <summary>
  26. /// Deserialize the entities.
  27. /// </summary>
  28. /// <returns>Whether deserialization was successful.</returns>
  29. /// <param name="serializationData">Serialized data to read from (read from GameSave.GC).</param>
  30. /// <param name="entitySerializer">Entity serializer with support for single-entity deserialization.</param>
  31. bool Deserialize(ref ISerializationData serializationData, IEntitySerialization entitySerializer);
  32. }
  33. }