public object GetOrCreate(Type type) { if (systemMap.TryGetValue(type, out var obj)) { return(obj); } obj = Activator.CreateInstance(type, args: WorldCollection); //new InjectPropertyStrategy(Ctx, true).Inject(obj); Add(obj, OrderedList.GetBefore(obj.GetType()), OrderedList.GetAfter(obj.GetType())); return(obj); }
public T GetOrCreate <T>(Func <WorldCollection, T> createFunction) where T : class, IWorldSystem { return(GetOrCreate(createFunction, OrderedList.GetBefore(typeof(T)), OrderedList.GetAfter(typeof(T)))); }