change defines

This commit is contained in:
Mikhail 2023-06-02 01:20:46 +08:00
parent 3e8cb3f8ff
commit a53fa7e717
8 changed files with 42 additions and 42 deletions

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
using static DCFApixels.DragonECS.EcsGroup.ThrowHelper; using static DCFApixels.DragonECS.EcsGroup.ThrowHelper;
#endif #endif
@ -149,7 +149,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (index < 0 || index >= Count) ThrowArgumentOutOfRange(); if (index < 0 || index >= Count) ThrowArgumentOutOfRange();
#endif #endif
return _dense[index]; return _dense[index];
@ -198,7 +198,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void AddInternal(int entityID) internal void AddInternal(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (Has(entityID)) ThrowAlreadyContains(entityID); if (Has(entityID)) ThrowAlreadyContains(entityID);
#endif #endif
if (++_count >= _dense.Length) if (++_count >= _dense.Length)
@ -216,7 +216,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void RemoveInternal(int entityID) internal void RemoveInternal(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowDoesNotContain(entityID); if (!Has(entityID)) ThrowDoesNotContain(entityID);
#endif #endif
_dense[_sparse[entityID]] = _dense[_count]; _dense[_sparse[entityID]] = _dense[_count];
@ -249,7 +249,7 @@ namespace DCFApixels.DragonECS
public void CopyFrom(EcsReadonlyGroup group) => CopyFrom(group.GetGroupInternal()); public void CopyFrom(EcsReadonlyGroup group) => CopyFrom(group.GetGroupInternal());
public void CopyFrom(EcsGroup group) public void CopyFrom(EcsGroup group)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (group.World != _source) throw new ArgumentException("groupFilter.WorldIndex != WorldIndex"); if (group.World != _source) throw new ArgumentException("groupFilter.WorldIndex != WorldIndex");
#endif #endif
if (_count > 0) if (_count > 0)
@ -285,7 +285,7 @@ namespace DCFApixels.DragonECS
public Span<int> ToSpan() => new Span<int>(_dense, 0, _count); public Span<int> ToSpan() => new Span<int>(_dense, 0, _count);
public Span<int> ToSpan(int start, int length) public Span<int> ToSpan(int start, int length)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (start + length > _count) ThrowArgumentOutOfRangeException(); if (start + length > _count) ThrowArgumentOutOfRangeException();
#endif #endif
return new Span<int>(_dense, start, length); return new Span<int>(_dense, start, length);
@ -299,7 +299,7 @@ namespace DCFApixels.DragonECS
/// <summary>as Union sets</summary> /// <summary>as Union sets</summary>
public void UnionWith(EcsGroup group) public void UnionWith(EcsGroup group)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_source != group.World) ThrowArgumentDifferentWorldsException(); if (_source != group.World) ThrowArgumentDifferentWorldsException();
#endif #endif
foreach (var item in group) foreach (var item in group)
@ -313,7 +313,7 @@ namespace DCFApixels.DragonECS
/// <summary>as Except sets</summary> /// <summary>as Except sets</summary>
public void ExceptWith(EcsGroup group) public void ExceptWith(EcsGroup group)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_source != group.World) ThrowArgumentDifferentWorldsException(); if (_source != group.World) ThrowArgumentDifferentWorldsException();
#endif #endif
foreach (var item in this) foreach (var item in this)
@ -327,7 +327,7 @@ namespace DCFApixels.DragonECS
/// <summary>as Intersect sets</summary> /// <summary>as Intersect sets</summary>
public void AndWith(EcsGroup group) public void AndWith(EcsGroup group)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (World != group.World) ThrowArgumentDifferentWorldsException(); if (World != group.World) ThrowArgumentDifferentWorldsException();
#endif #endif
foreach (var item in this) foreach (var item in this)
@ -341,7 +341,7 @@ namespace DCFApixels.DragonECS
/// <summary>as Symmetric Except sets</summary> /// <summary>as Symmetric Except sets</summary>
public void XorWith(EcsGroup group) public void XorWith(EcsGroup group)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_source != group.World) ThrowArgumentDifferentWorldsException(); if (_source != group.World) ThrowArgumentDifferentWorldsException();
#endif #endif
foreach (var item in group) foreach (var item in group)
@ -365,7 +365,7 @@ namespace DCFApixels.DragonECS
/// <returns>new group from pool</returns> /// <returns>new group from pool</returns>
public static EcsGroup Union(EcsGroup a, EcsGroup b) public static EcsGroup Union(EcsGroup a, EcsGroup b)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (a._source != b._source) ThrowArgumentDifferentWorldsException(); if (a._source != b._source) ThrowArgumentDifferentWorldsException();
#endif #endif
EcsGroup result = a._source.GetFreeGroup(); EcsGroup result = a._source.GetFreeGroup();
@ -379,7 +379,7 @@ namespace DCFApixels.DragonECS
/// <returns>new group from pool</returns> /// <returns>new group from pool</returns>
public static EcsGroup Except(EcsGroup a, EcsGroup b) public static EcsGroup Except(EcsGroup a, EcsGroup b)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (a._source != b._source) ThrowArgumentDifferentWorldsException(); if (a._source != b._source) ThrowArgumentDifferentWorldsException();
#endif #endif
EcsGroup result = a._source.GetFreeGroup(); EcsGroup result = a._source.GetFreeGroup();
@ -392,7 +392,7 @@ namespace DCFApixels.DragonECS
/// <returns>new group from pool</returns> /// <returns>new group from pool</returns>
public static EcsGroup And(EcsGroup a, EcsGroup b) public static EcsGroup And(EcsGroup a, EcsGroup b)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (a._source != b._source) ThrowArgumentDifferentWorldsException(); if (a._source != b._source) ThrowArgumentDifferentWorldsException();
#endif #endif
EcsGroup result = a._source.GetFreeGroup(); EcsGroup result = a._source.GetFreeGroup();
@ -406,7 +406,7 @@ namespace DCFApixels.DragonECS
/// <returns>new group from pool</returns> /// <returns>new group from pool</returns>
public static EcsGroup Xor(EcsGroup a, EcsGroup b) public static EcsGroup Xor(EcsGroup a, EcsGroup b)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (a._source != b._source) ThrowArgumentDifferentWorldsException(); if (a._source != b._source) ThrowArgumentDifferentWorldsException();
#endif #endif
EcsGroup result = a._source.GetFreeGroup(); EcsGroup result = a._source.GetFreeGroup();
@ -524,7 +524,7 @@ namespace DCFApixels.DragonECS
#endregion #endregion
#region ThrowHalper #region ThrowHalper
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
internal static class ThrowHelper internal static class ThrowHelper
{ {
[MethodImpl(MethodImplOptions.NoInlining)] [MethodImpl(MethodImplOptions.NoInlining)]

View File

@ -85,7 +85,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Run() public void Run()
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
CheckBeforeInitForMethod(nameof(Run)); CheckBeforeInitForMethod(nameof(Run));
CheckAfterDestroyForMethod(nameof(Run)); CheckAfterDestroyForMethod(nameof(Run));
#endif #endif
@ -93,7 +93,7 @@ namespace DCFApixels.DragonECS
} }
public void Destroy() public void Destroy()
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
CheckBeforeInitForMethod(nameof(Run)); CheckBeforeInitForMethod(nameof(Run));
#endif #endif
if (_isDestoryed == true) if (_isDestoryed == true)
@ -107,7 +107,7 @@ namespace DCFApixels.DragonECS
#endregion #endregion
#region StateChecks #region StateChecks
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
private void CheckBeforeInitForMethod(string methodName) private void CheckBeforeInitForMethod(string methodName)
{ {
if (!_isInit) if (!_isInit)

View File

@ -54,7 +54,7 @@ namespace DCFApixels.DragonECS
.Where(type => type.BaseType != null && type.BaseType.IsGenericType && runnerBaseType == type.BaseType.GetGenericTypeDefinition())); .Where(type => type.BaseType != null && type.BaseType.IsGenericType && runnerBaseType == type.BaseType.GetGenericTypeDefinition()));
} }
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
for (int i = 0; i < runnerHandlerTypes.Count; i++) for (int i = 0; i < runnerHandlerTypes.Count; i++)
{ {
var e = CheckRunnerValide(runnerHandlerTypes[i]); var e = CheckRunnerValide(runnerHandlerTypes[i]);
@ -129,7 +129,7 @@ namespace DCFApixels.DragonECS
private static Type _subclass; private static Type _subclass;
internal static void Register(Type subclass) internal static void Register(Type subclass)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_subclass != null) if (_subclass != null)
{ {
throw new EcsRunnerImplementationException($"The Runner<{typeof(TInterface).FullName}> can have only one implementing subclass"); throw new EcsRunnerImplementationException($"The Runner<{typeof(TInterface).FullName}> can have only one implementing subclass");

View File

@ -85,7 +85,7 @@ namespace DCFApixels.DragonECS
private void IncludeImplicit<TComponent>() private void IncludeImplicit<TComponent>()
{ {
int id = _world.GetComponentID<TComponent>(); int id = _world.GetComponentID<TComponent>();
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_inc.Contains(id) || _exc.Contains(id)) throw new EcsFrameworkException($"{typeof(TComponent).Name} already in constraints list."); if (_inc.Contains(id) || _exc.Contains(id)) throw new EcsFrameworkException($"{typeof(TComponent).Name} already in constraints list.");
#endif #endif
_inc.Add(_world.GetComponentID<TComponent>()); _inc.Add(_world.GetComponentID<TComponent>());
@ -93,7 +93,7 @@ namespace DCFApixels.DragonECS
private void ExcludeImplicit<TComponent>() private void ExcludeImplicit<TComponent>()
{ {
int id = _world.GetComponentID<TComponent>(); int id = _world.GetComponentID<TComponent>();
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (_inc.Contains(id) || _exc.Contains(id)) throw new EcsFrameworkException($"{typeof(TComponent).Name} already in constraints list."); if (_inc.Contains(id) || _exc.Contains(id)) throw new EcsFrameworkException($"{typeof(TComponent).Name} already in constraints list.");
#endif #endif
_exc.Add(_world.GetComponentID<TComponent>()); _exc.Add(_world.GetComponentID<TComponent>());

View File

@ -32,7 +32,7 @@
{ {
using (_executeWhere.Auto()) using (_executeWhere.Auto())
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (sourceGroup.IsNull) throw new System.ArgumentNullException();//TODO составить текст исключения. if (sourceGroup.IsNull) throw new System.ArgumentNullException();//TODO составить текст исключения.
#endif #endif
_subject.GetIteratorFor(sourceGroup).CopyTo(_filteredGroup); _subject.GetIteratorFor(sourceGroup).CopyTo(_filteredGroup);
@ -59,7 +59,7 @@
} }
public EcsGroup.Enumerator GetEnumerator() public EcsGroup.Enumerator GetEnumerator()
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!IsRelevant) throw new System.InvalidOperationException();//TODO составить текст исключения. if (!IsRelevant) throw new System.InvalidOperationException();//TODO составить текст исключения.
#endif #endif
return group.GetEnumerator(); return group.GetEnumerator();

View File

@ -57,7 +57,7 @@ namespace DCFApixels.DragonECS
public ref T Add(int entityID) public ref T Add(int entityID)
{ {
ref int itemIndex = ref _mapping[entityID]; ref int itemIndex = ref _mapping[entityID];
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (itemIndex > 0) ThrowAlreadyHasComponent<T>(entityID); if (itemIndex > 0) ThrowAlreadyHasComponent<T>(entityID);
#endif #endif
if (_recycledItemsCount > 0) if (_recycledItemsCount > 0)
@ -78,7 +78,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public ref T Get(int entityID) public ref T Get(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
_listeners.InvokeOnGet(entityID); _listeners.InvokeOnGet(entityID);
@ -87,7 +87,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public ref readonly T Read(int entityID) public ref readonly T Read(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
return ref _items[_mapping[entityID]]; return ref _items[_mapping[entityID]];
@ -121,7 +121,7 @@ namespace DCFApixels.DragonECS
} }
public void Del(int entityID) public void Del(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
ref int itemIndex = ref _mapping[entityID]; ref int itemIndex = ref _mapping[entityID];
@ -140,14 +140,14 @@ namespace DCFApixels.DragonECS
} }
public void Copy(int fromEntityID, int toEntityID) public void Copy(int fromEntityID, int toEntityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID); if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID);
#endif #endif
_componentCopyHandler.Copy(ref Get(fromEntityID), ref TryAddOrGet(toEntityID)); _componentCopyHandler.Copy(ref Get(fromEntityID), ref TryAddOrGet(toEntityID));
} }
public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID) public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID); if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID);
#endif #endif
_componentCopyHandler.Copy(ref Get(fromEntityID), ref toWorld.GetPool<T>().TryAddOrGet(toEntityID)); _componentCopyHandler.Copy(ref Get(fromEntityID), ref toWorld.GetPool<T>().TryAddOrGet(toEntityID));

View File

@ -43,7 +43,7 @@ namespace DCFApixels.DragonECS
#region Method #region Method
public void Add(int entityID) public void Add(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (Has(entityID)) ThrowAlreadyHasComponent<T>(entityID); if (Has(entityID)) ThrowAlreadyHasComponent<T>(entityID);
#endif #endif
_count++; _count++;
@ -68,7 +68,7 @@ namespace DCFApixels.DragonECS
} }
public void Del(int entityID) public void Del(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
_mapping[entityID] = false; _mapping[entityID] = false;
@ -82,14 +82,14 @@ namespace DCFApixels.DragonECS
} }
public void Copy(int fromEntityID, int toEntityID) public void Copy(int fromEntityID, int toEntityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID); if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID);
#endif #endif
TryAdd(toEntityID); TryAdd(toEntityID);
} }
public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID) public void Copy(int fromEntityID, EcsWorld toWorld, int toEntityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID); if (!Has(fromEntityID)) ThrowNotHaveComponent<T>(fromEntityID);
#endif #endif
toWorld.GetPool<T>().TryAdd(toEntityID); toWorld.GetPool<T>().TryAdd(toEntityID);
@ -138,14 +138,14 @@ namespace DCFApixels.DragonECS
} }
ref readonly T IEcsPool<T>.Read(int entityID) ref readonly T IEcsPool<T>.Read(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
return ref _fakeComponent; return ref _fakeComponent;
} }
ref T IEcsPool<T>.Get(int entityID) ref T IEcsPool<T>.Get(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
return ref _fakeComponent; return ref _fakeComponent;
@ -153,14 +153,14 @@ namespace DCFApixels.DragonECS
void IEcsPool.AddRaw(int entityID, object dataRaw) => Add(entityID); void IEcsPool.AddRaw(int entityID, object dataRaw) => Add(entityID);
object IEcsPool.GetRaw(int entityID) object IEcsPool.GetRaw(int entityID)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
return _fakeComponent; return _fakeComponent;
} }
void IEcsPool.SetRaw(int entityID, object dataRaw) void IEcsPool.SetRaw(int entityID, object dataRaw)
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID); if (!Has(entityID)) ThrowNotHaveComponent<T>(entityID);
#endif #endif
} }

View File

@ -40,7 +40,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!IsAlive) ThrowIsNotAlive(this); if (!IsAlive) ThrowIsNotAlive(this);
#endif #endif
return id; return id;
@ -51,7 +51,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!IsAlive) ThrowIsNotAlive(this); if (!IsAlive) ThrowIsNotAlive(this);
#endif #endif
return gen; return gen;
@ -62,7 +62,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!IsAlive) ThrowIsNotAlive(this); if (!IsAlive) ThrowIsNotAlive(this);
#endif #endif
return EcsWorld.Worlds[world]; return EcsWorld.Worlds[world];
@ -73,7 +73,7 @@ namespace DCFApixels.DragonECS
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
get get
{ {
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!IsAlive) ThrowIsNotAlive(this); if (!IsAlive) ThrowIsNotAlive(this);
#endif #endif
return world; return world;