From a7c6a5856a8bac6b1e24f7f5eee32585f6dbb48b Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 22 Jun 2023 14:39:35 +0800 Subject: [PATCH] refactoring --- src/AutoInjectSystem.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AutoInjectSystem.cs b/src/AutoInjectSystem.cs index 0619dd0..e10a5e9 100644 --- a/src/AutoInjectSystem.cs +++ b/src/AutoInjectSystem.cs @@ -46,7 +46,8 @@ namespace DCFApixels.DragonECS .Where(o => o.GetCustomAttribute() != null) .Select(o => new InjectedField(o))); result.AddRange(type.GetProperties(bindingFlags) - .Where(o => { + .Where(o => + { if (o.GetCustomAttribute() == null) return false; #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS @@ -57,7 +58,8 @@ namespace DCFApixels.DragonECS }) .Select(o => new InjectedProperty(o))); result.AddRange(type.GetMethods(bindingFlags) - .Where(o => { + .Where(o => + { if (o.GetCustomAttribute() == null) return false; #if (DEBUG && !DISABLE_DEBUG) || ENABLE_DRAGONECS_ASSERT_CHEKS @@ -160,7 +162,7 @@ namespace DCFApixels.DragonECS public void Inject(EcsPipeline obj) => _pipeline = obj; public void PreInject(object obj) { - if(!_preInitInjectCompleted) + if (!_preInitInjectCompleted) _delayedInjects.Add(obj); else _autoInjectionMap.Inject(obj.GetType(), obj);