From 6c0856a252763cd79098ac26102f590d8c2cd28d Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Mon, 26 Jun 2023 02:58:53 +0800 Subject: [PATCH] update exceptions --- src/AutoInjectSystem.cs | 2 +- src/Utils/Exceptions.cs | 33 ++++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/AutoInjectSystem.cs b/src/AutoInjectSystem.cs index fa9c4b2..dc6b0cf 100644 --- a/src/AutoInjectSystem.cs +++ b/src/AutoInjectSystem.cs @@ -1,8 +1,8 @@ +using DCFApixels.DragonECS.AutoInjectionsInternal; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using static DCFApixels.DragonECS.EcsThrowHalper; namespace DCFApixels.DragonECS { diff --git a/src/Utils/Exceptions.cs b/src/Utils/Exceptions.cs index 9fb2a7f..cb1eadc 100644 --- a/src/Utils/Exceptions.cs +++ b/src/Utils/Exceptions.cs @@ -5,23 +5,26 @@ using System.Runtime.Serialization; namespace DCFApixels.DragonECS { - public static class EcsThrowHalper_AutoInjections + namespace AutoInjectionsInternal { - [MethodImpl(MethodImplOptions.NoInlining)] - internal static void PropertyIsCantWrite(this EcsThrowHalper _, MemberInfo obj) + internal static class Throw { - throw new EcsAutoInjectionException($"{obj.Name} property is cant write"); - } - [MethodImpl(MethodImplOptions.NoInlining)] - internal static void MethodIsGeneric(this EcsThrowHalper _, MemberInfo obj) - { - throw new EcsAutoInjectionException($"{obj.Name} method is Generic"); - } - [MethodImpl(MethodImplOptions.NoInlining)] - internal static void MethodArgumentsGreater1(this EcsThrowHalper _, MemberInfo obj) - { - //method X has arguments greater than 1. - throw new EcsAutoInjectionException($"{obj.Name} method Arguments != 1"); + [MethodImpl(MethodImplOptions.NoInlining)] + internal static void PropertyIsCantWrite(MemberInfo obj) + { + throw new EcsAutoInjectionException($"{obj.Name} property is cant write"); + } + [MethodImpl(MethodImplOptions.NoInlining)] + internal static void MethodIsGeneric(MemberInfo obj) + { + throw new EcsAutoInjectionException($"{obj.Name} method is Generic"); + } + [MethodImpl(MethodImplOptions.NoInlining)] + internal static void MethodArgumentsGreater1(MemberInfo obj) + { + //method X has arguments greater than 1. + throw new EcsAutoInjectionException($"{obj.Name} method Arguments != 1"); + } } }