Files
TEngine/Assets/GameScripts/DotNet/Core/Entity/IUpdateSystem.cs
ALEXTANG 336d4b2eb9 [+] 接入ET8服务端
[+] 接入ET8服务端
2023-07-13 12:23:48 +08:00

40 lines
571 B
C#

using System;
namespace ET
{
public interface IUpdate
{
}
public interface IUpdateSystem: ISystemType
{
void Run(Entity o);
}
[EntitySystem]
public abstract class UpdateSystem<T> : IUpdateSystem where T: Entity, IUpdate
{
void IUpdateSystem.Run(Entity o)
{
this.Update((T)o);
}
Type ISystemType.Type()
{
return typeof(T);
}
Type ISystemType.SystemType()
{
return typeof(IUpdateSystem);
}
int ISystemType.GetInstanceQueueIndex()
{
return InstanceQueueIndex.Update;
}
protected abstract void Update(T self);
}
}