Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public T GetOrCreate <T>(Func <WorldCollection, T> createFunction) where T : class, IWorldSystem
 {
     return(GetOrCreate(createFunction, OrderedList.GetBefore(typeof(T)), OrderedList.GetAfter(typeof(T))));
 }