30 lines
891 B
C#
30 lines
891 B
C#
// using Fantasy.Entitas;
|
|
// using Fantasy.Network;
|
|
// using Fantasy.Serialize;
|
|
//
|
|
// namespace NBF
|
|
// {
|
|
// public class SerializerComponent : Entity
|
|
// {
|
|
// public ISerialize Serialize;
|
|
// public readonly MemoryStreamBufferPool BufferPool = new MemoryStreamBufferPool();
|
|
//
|
|
//
|
|
// public void Initialize()
|
|
// {
|
|
// Serialize = SerializerManager.ProtoBufHelper;
|
|
// }
|
|
//
|
|
// public byte[] Serialize<T>(T @object)
|
|
// {
|
|
// using var memoryStreamBuffer = BufferPool.RentMemoryStream(MemoryStreamBufferSource.None);
|
|
// Serialize.Serialize(typeof(T), @object, memoryStreamBuffer);
|
|
// return memoryStreamBuffer.ToArray();
|
|
// }
|
|
//
|
|
// public T Deserialize<T>(byte[] bytes)
|
|
// {
|
|
// return Serialize.Deserialize<T>(bytes);
|
|
// }
|
|
// }
|
|
// } |