mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-19 02:24:37 +08:00
remove world interface
This commit is contained in:
parent
65861cb798
commit
cb25943b55
@ -17,7 +17,7 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
public IEcsWorld World
|
public EcsWorld World
|
||||||
{
|
{
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
get => _source.World;
|
get => _source.World;
|
||||||
|
@ -12,7 +12,6 @@ namespace DCFApixels.DragonECS
|
|||||||
private EcsWorld _targetWorld;
|
private EcsWorld _targetWorld;
|
||||||
private EcsAttachPool<TAttachComponent> _targetPool;
|
private EcsAttachPool<TAttachComponent> _targetPool;
|
||||||
|
|
||||||
|
|
||||||
private int _targetWorldCapacity = -1;
|
private int _targetWorldCapacity = -1;
|
||||||
private int _targetPoolCapacity = -1;
|
private int _targetPoolCapacity = -1;
|
||||||
|
|
||||||
@ -45,6 +44,8 @@ namespace DCFApixels.DragonECS
|
|||||||
public sealed override void ExecuteJoin()
|
public sealed override void ExecuteJoin()
|
||||||
{
|
{
|
||||||
_execute.Begin();
|
_execute.Begin();
|
||||||
|
|
||||||
|
_isJoinExecuted = false;
|
||||||
if (_isInitTargetWorlds == false)
|
if (_isInitTargetWorlds == false)
|
||||||
{
|
{
|
||||||
InitTargetWorlds();
|
InitTargetWorlds();
|
||||||
|
@ -5,22 +5,7 @@ using System.Runtime.InteropServices;
|
|||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
namespace DCFApixels.DragonECS
|
||||||
{
|
{
|
||||||
public interface IEcsWorld : IEcsTable
|
public abstract class EcsWorld
|
||||||
{
|
|
||||||
#region Properties
|
|
||||||
public int UniqueID { get; }
|
|
||||||
public EcsPipeline Pipeline { get; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Entities
|
|
||||||
public EcsEntity NewEntity();
|
|
||||||
public void DelEntity(EcsEntity entity);
|
|
||||||
public bool EntityIsAlive(int entityID, short gen);
|
|
||||||
public EcsEntity GetEcsEntity(int entityID);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class EcsWorld : IEcsWorld
|
|
||||||
{
|
{
|
||||||
private const short GEN_BITS = 0x7fff;
|
private const short GEN_BITS = 0x7fff;
|
||||||
private const short DEATH_GEN_BIT = short.MinValue;
|
private const short DEATH_GEN_BIT = short.MinValue;
|
||||||
@ -265,19 +250,16 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Groups
|
#region Groups
|
||||||
void IEcsTable.RegisterGroup(EcsGroup group) => RegisterGroup(group);
|
|
||||||
internal void RegisterGroup(EcsGroup group)
|
internal void RegisterGroup(EcsGroup group)
|
||||||
{
|
{
|
||||||
_groups.Add(new WeakReference<EcsGroup>(group));
|
_groups.Add(new WeakReference<EcsGroup>(group));
|
||||||
}
|
}
|
||||||
EcsGroup IEcsTable.GetGroupFromPool() => GetGroupFromPool();
|
|
||||||
internal EcsGroup GetGroupFromPool()
|
internal EcsGroup GetGroupFromPool()
|
||||||
{
|
{
|
||||||
if (_groupsPool.Count <= 0)
|
if (_groupsPool.Count <= 0)
|
||||||
return new EcsGroup(this);
|
return new EcsGroup(this);
|
||||||
return _groupsPool.Pop();
|
return _groupsPool.Pop();
|
||||||
}
|
}
|
||||||
void IEcsTable.ReleaseGroup(EcsGroup group) => ReleaseGroup(group);
|
|
||||||
internal void ReleaseGroup(EcsGroup group)
|
internal void ReleaseGroup(EcsGroup group)
|
||||||
{
|
{
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || !DRAGONECS_NO_SANITIZE_CHECKS
|
#if (DEBUG && !DISABLE_DEBUG) || !DRAGONECS_NO_SANITIZE_CHECKS
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS
|
|
||||||
{
|
|
||||||
public interface IEcsTable
|
|
||||||
{
|
|
||||||
#region Properties
|
|
||||||
/// <summary>Table Archetype</summary>
|
|
||||||
public Type Archetype { get; }
|
|
||||||
public int Count { get; }
|
|
||||||
public int Capacity { get; }
|
|
||||||
public EcsReadonlyGroup Entities => default;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Methods
|
|
||||||
public int GetComponentID<T>();
|
|
||||||
public TPool GetPool<TComponent, TPool>() where TComponent : struct where TPool : EcsPoolBase<TComponent>, new();
|
|
||||||
public ReadOnlySpan<EcsPoolBase> GetAllPools();
|
|
||||||
public TQuery Select<TQuery>() where TQuery : EcsQueryBase;
|
|
||||||
public TQuery Where<TQuery>(out TQuery query) where TQuery : EcsQuery;
|
|
||||||
// public TQuery Join<TQuery>(out TQuery query) where TQuery : EcsJoinQueryBase;
|
|
||||||
|
|
||||||
public bool IsMaskCompatible(EcsComponentMask mask, int entityID);
|
|
||||||
|
|
||||||
public void Destroy();
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Internal Methods
|
|
||||||
internal void RegisterGroup(EcsGroup group);
|
|
||||||
internal EcsGroup GetGroupFromPool();
|
|
||||||
internal void ReleaseGroup(EcsGroup group);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user