using System.Runtime.CompilerServices;
using Svelto.ECS.Internal;
namespace Svelto.ECS.Serialization
{
public interface IEntitySerialization
{
///
/// Fill the serializationData of the entitiesToSerialize of this descriptor
///
///
///
///
/// Size in bytes of the newly instantiated entity
void SerializeEntity(EGID egid, ISerializationData serializationData, int serializationType);
///
/// Deserialize a serializationData and copy directly onto the appropriate entities
///
///
///
///
void DeserializeEntity(ISerializationData serializationData, int serializationType);
///
/// Deserialize a serializationData and copy directly onto the appropriate entities with explicit EGID
///
///
///
///
///
void DeserializeEntity(EGID egid, ISerializationData serializationData, int serializationType);
///
/// Deserialize a serializationData and copy directly to an previously created EntityInitializer
///
///
///
///
///
void DeserializeEntityComponents(ISerializationData serializationData,
ISerializableEntityDescriptor entityDescriptor,
ref EntityInitializer initializer, int serializationType);
///
/// Contrary to the other Deserialize methods that assume that the entity exists, this method is used to deserialise
/// a new Entity
///
///
///
///
///
EntityInitializer DeserializeNewEntity(EGID egid, ISerializationData serializationData,
int serializationType);
///
/// Skips over entities without deserializing them, but incrementing the data position of the serialization data
/// as if it had
///
///
///
///
void SkipEntityDeserialization(ISerializationData serializationData, int serializationType,
int numberOfEntities);
///
/// Special Entity Swap method that works without knowing the EntityDescriptor to swap
///
///
///
///
void DeserializeEntityToSwap(EGID fromEGID, EGID toEGID, [CallerMemberName] string caller = null);
///
/// Special Entity delete method that works without knowing the EntityDescriptor to delete
///
///
void DeserializeEntityToDelete(EGID egid, [CallerMemberName] string caller = null);
uint GetHashFromGroup(ExclusiveGroupStruct groupStruct);
ExclusiveGroupStruct GetGroupFromHash(uint groupHash);
void RegisterSerializationFactory(IDeserializationFactory deserializationFactory)
where T : ISerializableEntityDescriptor, new();
T DeserializeEntityComponent(ISerializationData serializationData,
ISerializableEntityDescriptor entityDescriptor, int serializationType)
where T : unmanaged, IEntityComponent;
}
}