/// <summary> /// Initializes a new instance of the <see cref="RegisterTypeAttribute"/> class. /// </summary> /// <param name="base"> Base type. </param> /// <param name="derived"> Derived type, usually is the type this attribute is adorned on. </param> public RegisterTypeAttribute(Type @base, Type derived) { ValidateArg.NotNull(@base, nameof(@base)); if ([email protected](derived)) { AIDebug.Logger.WriteError($"{derived} is not a derived type of {@base}."); } AwesomeInventoryServiceProvider.AddType(@base, derived); }
/// <summary> /// Register derived type of <see cref="GenericThingSelector"/>. /// </summary> /// <typeparam name="T"> Derived Type of <see cref="GenericThingSelector"/>. </typeparam> protected static void RegisterGenericThingSelector <T>() where T : GenericThingSelector => AwesomeInventoryServiceProvider.AddType(typeof(GenericThingSelector), typeof(T));
/// <summary> /// Register derived type of <see cref="ThingGroupSelector"/>. /// </summary> /// <typeparam name="T"> Derived Type of <see cref="ThingGroupSelector"/>. </typeparam> protected static void RegisterThingGroupSelector <T>() where T : ThingGroupSelector => AwesomeInventoryServiceProvider.AddType(typeof(ThingGroupSelector), typeof(T));
/// <summary> /// Register derived type of <see cref="Dialog_ManageLoadouts"/>. /// </summary> /// <typeparam name="T"> Derived type of <see cref="Dialog_ManageLoadouts"/>. </typeparam> protected static void RegisterDialogManageLoadout <T>() where T : Dialog_ManageLoadouts => AwesomeInventoryServiceProvider.AddType(typeof(Dialog_ManageLoadouts), typeof(T));