Mirror of Svelto.ECS because we're a fan of it
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.

17 lines
925B

  1. using Svelto.ECS.Internal;
  2. #if DEBUG && !PROFILE_SVELTO
  3. #endif
  4. namespace Svelto.ECS.Serialization
  5. {
  6. public interface IComponentSerializer<T> where T : unmanaged, _IInternalEntityComponent
  7. {
  8. bool Serialize(in T value, ISerializationData serializationData);
  9. bool Deserialize(ref T value, ISerializationData serializationData);
  10. //Todo: We currently use the value 0 (which I am not even sure if it's not ambiguous) to mark an entity as dynamic size. If zero the systems assumes that the first word to deserialize
  11. //is the size of the entity. However this means that this field cannot reliably be used to know the size of the entity before hand, we need to either remove all the ambiguities in
  12. //this sense or find another way to serialise dynamic size entities.
  13. //note must stay uint because it's too late to convert it for old projects
  14. uint size { get; }
  15. }
  16. }