2023-12-24 15:40:19 +08:00
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
|
|
namespace DCFApixels.DragonECS
|
2023-05-07 00:50:02 +08:00
|
|
|
|
{
|
|
|
|
|
public abstract class EcsQueryExecutor
|
|
|
|
|
{
|
2023-12-24 15:40:19 +08:00
|
|
|
|
private EcsWorld _source;
|
2024-03-17 05:22:36 +08:00
|
|
|
|
public short WorldID
|
2023-12-24 15:40:19 +08:00
|
|
|
|
{
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
2024-03-17 05:22:36 +08:00
|
|
|
|
get { return _source.id; }
|
2023-12-24 15:40:19 +08:00
|
|
|
|
}
|
|
|
|
|
public EcsWorld World
|
|
|
|
|
{
|
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
2024-03-17 05:22:36 +08:00
|
|
|
|
get { return _source; }
|
2023-12-24 15:40:19 +08:00
|
|
|
|
}
|
|
|
|
|
public abstract long Version { get; }
|
2023-05-27 15:59:46 +08:00
|
|
|
|
internal void Initialize(EcsWorld world)
|
|
|
|
|
{
|
2023-12-24 15:40:19 +08:00
|
|
|
|
_source = world;
|
2023-05-27 15:59:46 +08:00
|
|
|
|
OnInitialize();
|
|
|
|
|
}
|
2023-12-24 15:40:19 +08:00
|
|
|
|
internal void Destroy()
|
|
|
|
|
{
|
|
|
|
|
OnDestroy();
|
|
|
|
|
_source = null;
|
|
|
|
|
}
|
2023-06-08 04:04:39 +08:00
|
|
|
|
protected abstract void OnInitialize();
|
2023-05-26 06:18:09 +08:00
|
|
|
|
protected abstract void OnDestroy();
|
2023-05-07 00:50:02 +08:00
|
|
|
|
}
|
2023-12-24 15:40:19 +08:00
|
|
|
|
}
|