mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-17 17:34:36 +08:00
hot fixes
This commit is contained in:
parent
dca386f0d2
commit
17813b29cb
@ -13,9 +13,10 @@ namespace DCFApixels.DragonECS
|
|||||||
[MetaID("DragonECS_4EE3527C92015BAB0299CB7B4E2663D1")]
|
[MetaID("DragonECS_4EE3527C92015BAB0299CB7B4E2663D1")]
|
||||||
public sealed class EcsDefaultWorld : EcsWorld, IInjectionUnit
|
public sealed class EcsDefaultWorld : EcsWorld, IInjectionUnit
|
||||||
{
|
{
|
||||||
public EcsDefaultWorld() : base() { }
|
private const string DEFAULT_NAME = "Default";
|
||||||
public EcsDefaultWorld(EcsWorldConfig config = null, string name = null, short worldID = -1) : base(config, name == null ? "Default" : name, worldID) { }
|
public EcsDefaultWorld() : base(default(EcsWorldConfig), DEFAULT_NAME) { }
|
||||||
public EcsDefaultWorld(IConfigContainer configs, string name = null, short worldID = -1) : base(configs, name == null ? "Default" : name, worldID) { }
|
public EcsDefaultWorld(EcsWorldConfig config = null, string name = null, short worldID = -1) : base(config, name == null ? DEFAULT_NAME : name, worldID) { }
|
||||||
|
public EcsDefaultWorld(IConfigContainer configs, string name = null, short worldID = -1) : base(configs, name == null ? DEFAULT_NAME : name, worldID) { }
|
||||||
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
||||||
}
|
}
|
||||||
/// <summary> EcsWrold for store event entities. </summary>
|
/// <summary> EcsWrold for store event entities. </summary>
|
||||||
@ -26,9 +27,10 @@ namespace DCFApixels.DragonECS
|
|||||||
[MetaID("DragonECS_D7CE527C920160BCD765EFA72DBF8B89")]
|
[MetaID("DragonECS_D7CE527C920160BCD765EFA72DBF8B89")]
|
||||||
public sealed class EcsEventWorld : EcsWorld, IInjectionUnit
|
public sealed class EcsEventWorld : EcsWorld, IInjectionUnit
|
||||||
{
|
{
|
||||||
public EcsEventWorld() : base() { }
|
private const string DEFAULT_NAME = "Events";
|
||||||
public EcsEventWorld(EcsWorldConfig config = null, string name = null, short worldID = -1) : base(config, name == null ? "Events" : name, worldID) { }
|
public EcsEventWorld() : base(default(EcsWorldConfig), DEFAULT_NAME) { }
|
||||||
public EcsEventWorld(IConfigContainer configs, string name = null, short worldID = -1) : base(configs, name == null ? "Events" : name, worldID) { }
|
public EcsEventWorld(EcsWorldConfig config = null, string name = null, short worldID = -1) : base(config, name == null ? DEFAULT_NAME : name, worldID) { }
|
||||||
|
public EcsEventWorld(IConfigContainer configs, string name = null, short worldID = -1) : base(configs, name == null ? DEFAULT_NAME : name, worldID) { }
|
||||||
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
void IInjectionUnit.InitInjectionNode(InjectionGraph nodes) { nodes.AddNode(this); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,6 +257,38 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
return Get<AspectCache<TAspect>>().Instance;
|
return Get<AspectCache<TAspect>>().Instance;
|
||||||
}
|
}
|
||||||
|
public void GetAspects<TAspect0>(out TAspect0 a0)
|
||||||
|
where TAspect0 : new()
|
||||||
|
{
|
||||||
|
a0 = GetAspect<TAspect0>();
|
||||||
|
}
|
||||||
|
public void GetAspects<TAspect0, TAspect1>(out TAspect0 a0, out TAspect1 a1)
|
||||||
|
where TAspect0 : new()
|
||||||
|
where TAspect1 : new()
|
||||||
|
{
|
||||||
|
a0 = GetAspect<TAspect0>();
|
||||||
|
a1 = GetAspect<TAspect1>();
|
||||||
|
}
|
||||||
|
public void GetAspects<TAspect0, TAspect1, TAspect2>(out TAspect0 a0, out TAspect1 a1, out TAspect2 a2)
|
||||||
|
where TAspect0 : new()
|
||||||
|
where TAspect1 : new()
|
||||||
|
where TAspect2 : new()
|
||||||
|
{
|
||||||
|
a0 = GetAspect<TAspect0>();
|
||||||
|
a1 = GetAspect<TAspect1>();
|
||||||
|
a2 = GetAspect<TAspect2>();
|
||||||
|
}
|
||||||
|
public void GetAspects<TAspect0, TAspect1, TAspect2, TAspect3>(out TAspect0 a0, out TAspect1 a1, out TAspect2 a2, out TAspect3 a3)
|
||||||
|
where TAspect0 : new()
|
||||||
|
where TAspect1 : new()
|
||||||
|
where TAspect2 : new()
|
||||||
|
where TAspect3 : new()
|
||||||
|
{
|
||||||
|
a0 = GetAspect<TAspect0>();
|
||||||
|
a1 = GetAspect<TAspect1>();
|
||||||
|
a2 = GetAspect<TAspect2>();
|
||||||
|
a3 = GetAspect<TAspect3>();
|
||||||
|
}
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public TAspect GetAspect<TAspect>(out EcsMask mask) where TAspect : new()
|
public TAspect GetAspect<TAspect>(out EcsMask mask) where TAspect : new()
|
||||||
{
|
{
|
||||||
@ -1185,6 +1217,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
private EcsWorld _world;
|
private EcsWorld _world;
|
||||||
private List<MaskQueryExecutor> _queries;
|
private List<MaskQueryExecutor> _queries;
|
||||||
|
public string Name { get { return _world.Name; } }
|
||||||
public EntitySlotInfo[] Entities
|
public EntitySlotInfo[] Entities
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -68,6 +68,24 @@ namespace DCFApixels.DragonECS.Internal
|
|||||||
{
|
{
|
||||||
_version++;
|
_version++;
|
||||||
_iterator.IterateTo(World.Entities, _filteredAllGroup);
|
_iterator.IterateTo(World.Entities, _filteredAllGroup);
|
||||||
|
#if DEBUG && DRAGONECS_DEEP_DEBUG
|
||||||
|
if(_filteredGroup == null)
|
||||||
|
{
|
||||||
|
_filteredGroup = EcsGroup.New(World);
|
||||||
|
}
|
||||||
|
_filteredGroup.Clear();
|
||||||
|
foreach (var e in World.Entities)
|
||||||
|
{
|
||||||
|
if(World.IsMatchesMask(Mask, e))
|
||||||
|
{
|
||||||
|
_filteredGroup.Add(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_filteredAllGroup.SetEquals(_filteredGroup) == false)
|
||||||
|
{
|
||||||
|
throw new System.InvalidOperationException();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
@ -158,17 +158,17 @@ namespace DCFApixels.DragonECS.Core
|
|||||||
{
|
{
|
||||||
*_versions = _world.Version;
|
*_versions = _world.Version;
|
||||||
|
|
||||||
long* ptr = _versions;
|
long* versionsPtr = _versions;
|
||||||
var slots = _world._poolSlots;
|
var slots = _world._poolSlots;
|
||||||
foreach (var slotIndex in _maskInc)
|
foreach (var slotIndex in _maskInc)
|
||||||
{
|
{
|
||||||
ptr++;
|
versionsPtr++;
|
||||||
*ptr = slots[slotIndex].version;
|
*versionsPtr = slots[slotIndex].version;
|
||||||
}
|
}
|
||||||
foreach (var slotIndex in _maskExc)
|
foreach (var slotIndex in _maskExc)
|
||||||
{
|
{
|
||||||
ptr++;
|
versionsPtr++;
|
||||||
*ptr = slots[slotIndex].version;
|
*versionsPtr = slots[slotIndex].version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool CheckAndNext()
|
public bool CheckAndNext()
|
||||||
@ -179,26 +179,28 @@ namespace DCFApixels.DragonECS.Core
|
|||||||
}
|
}
|
||||||
*_versions = _world.Version;
|
*_versions = _world.Version;
|
||||||
|
|
||||||
long* ptr = _versions;
|
long* versionsPtr = _versions;
|
||||||
var slots = _world._poolSlots;
|
var slots = _world._poolSlots;
|
||||||
bool result = _count != 1;
|
bool result = _count != 1;
|
||||||
foreach (var slotIndex in _maskInc)
|
foreach (var slotIndex in _maskInc)
|
||||||
{
|
{
|
||||||
ptr++;
|
versionsPtr++;
|
||||||
if (*ptr != slots[slotIndex].version)
|
if (*versionsPtr != slots[slotIndex].version)
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
*ptr = slots[slotIndex].version;
|
*versionsPtr = slots[slotIndex].version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var slotIndex in _maskExc)
|
foreach (var slotIndex in _maskExc)
|
||||||
{
|
{
|
||||||
ptr++;
|
return false; //TODO hotfix, не правильная логика проверки версия для EXC, потому сейчас она скипается
|
||||||
if (*ptr != slots[slotIndex].version)
|
|
||||||
{
|
//versionsPtr++;
|
||||||
result = false;
|
//if (*versionsPtr != slots[slotIndex].version)
|
||||||
*ptr = slots[slotIndex].version;
|
//{
|
||||||
}
|
// result = false;
|
||||||
|
// *versionsPtr = slots[slotIndex].version;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user