mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
43
Assets/GameScripts/DotNet/Core/Entity/IDeserializeSystem.cs
Normal file
43
Assets/GameScripts/DotNet/Core/Entity/IDeserializeSystem.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public interface IDeserialize
|
||||
{
|
||||
}
|
||||
|
||||
public interface IDeserializeSystem: ISystemType
|
||||
{
|
||||
void Run(Entity o);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化后执行的System
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
[EntitySystem]
|
||||
public abstract class DeserializeSystem<T> : IDeserializeSystem where T: Entity, IDeserialize
|
||||
{
|
||||
void IDeserializeSystem.Run(Entity o)
|
||||
{
|
||||
this.Deserialize((T)o);
|
||||
}
|
||||
|
||||
Type ISystemType.SystemType()
|
||||
{
|
||||
return typeof(IDeserializeSystem);
|
||||
}
|
||||
|
||||
int ISystemType.GetInstanceQueueIndex()
|
||||
{
|
||||
return InstanceQueueIndex.None;
|
||||
}
|
||||
|
||||
Type ISystemType.Type()
|
||||
{
|
||||
return typeof(T);
|
||||
}
|
||||
|
||||
protected abstract void Deserialize(T self);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user