mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 13:23:40 +01:00
feat: add InherentDependencyAttribute, mark PM inherently dependent on IM
This commit is contained in:
parent
4a228f4e3b
commit
f40ea4310c
5 changed files with 34 additions and 4 deletions
|
|
@ -128,6 +128,11 @@ internal static class Service<T> where T : IServiceType
|
|||
.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
|
||||
.Select(x => x.FieldType)
|
||||
.Where(x => x.GetCustomAttribute<ServiceManager.ServiceDependency>(true) != null));
|
||||
res.AddRange(typeof(T)
|
||||
.GetCustomAttributes()
|
||||
.OfType<InherentDependencyAttribute>()
|
||||
.Select(x => x.GetType().GetGenericArguments().First()));
|
||||
|
||||
return res
|
||||
.Distinct()
|
||||
.Select(x => typeof(Service<>).MakeGenericType(x))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue