mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
simple refactoring
This commit is contained in:
parent
2e0765626e
commit
815b1c2bb0
@ -1,5 +1,12 @@
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
//TODO использовать этот мир для холостых вызовов. чтоб все нулевые ентити стучались в него, так можно попробовать сократить число проверок
|
||||
//internal sealed class EcsDeathWrold : EcsWorld<EcsDefaultWrold>
|
||||
//{
|
||||
// public EcsDeathWrold(EcsPipeline pipeline) : base(pipeline) { }
|
||||
//}
|
||||
|
||||
|
||||
public sealed class EcsDefaultWrold : EcsWorld<EcsDefaultWrold>
|
||||
{
|
||||
public EcsDefaultWrold(EcsPipeline pipeline) : base(pipeline) { }
|
||||
|
@ -10,8 +10,12 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
private readonly EcsGroup _source;
|
||||
|
||||
#region Constructors
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public EcsReadonlyGroup(EcsGroup source) => _source = source;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
public int Count
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@ -27,10 +31,14 @@ namespace DCFApixels.DragonECS
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _source.CapacitySparce;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Contains(int entityID) => _source.Contains(entityID);
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public EcsGroup.Enumerator GetEnumerator() => _source.GetEnumerator();
|
||||
#endregion
|
||||
}
|
||||
|
||||
// не может содержать значение 0
|
||||
@ -174,8 +182,6 @@ namespace DCFApixels.DragonECS
|
||||
_sparse[entityID] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private void AddDelayedOp(int entityID, int isAddBitFlag)
|
||||
{
|
||||
|
@ -56,7 +56,6 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
private readonly int _id;
|
||||
private readonly IEcsWorld _source;
|
||||
// private readonly EcsGroup _entities;
|
||||
|
||||
private int[] _mapping;// index = entity / value = itemIndex;/ value = 0 = no entity
|
||||
private T[] _items; //dense
|
||||
|
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
using static UnityEditor.Progress;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user