defines refactoring

This commit is contained in:
DCFApixels 2025-03-15 15:10:16 +08:00
parent 0684b90584
commit a0bec24fd2

View File

@ -66,7 +66,7 @@ namespace DCFApixels.DragonECS
{ {
return false; return false;
} }
#if DEBUG || ENABLE_DRAGONECS_ASSERT_CHEKS #if DEBUG
if (!isAgressiveInjection && o.CanWrite == false) { Throw.PropertyIsCantWrite(o); } if (!isAgressiveInjection && o.CanWrite == false) { Throw.PropertyIsCantWrite(o); }
#endif #endif
return o.CanWrite; return o.CanWrite;
@ -81,13 +81,13 @@ namespace DCFApixels.DragonECS
return false; return false;
} }
var parameters = o.GetParameters(); var parameters = o.GetParameters();
#if DEBUG || ENABLE_DRAGONECS_ASSERT_CHEKS
if (!isAgressiveInjection) if (!isAgressiveInjection)
{ {
#if DEBUG
if (o.IsGenericMethod) { Throw.MethodIsGeneric(o); } if (o.IsGenericMethod) { Throw.MethodIsGeneric(o); }
if (parameters.Length != 1) { Throw.MethodArgumentsGreater1(o); } if (parameters.Length != 1) { Throw.MethodArgumentsGreater1(o); }
}
#endif #endif
}
return o.IsGenericMethod == false && parameters.Length == 1; return o.IsGenericMethod == false && parameters.Length == 1;
}) })
.Select(o => new InjectedMethod(o))); .Select(o => new InjectedMethod(o)));