Esempio n. 1
0
        public Registry <T> CreateRegistry <T>(IRegistryHandler <T> handler) where T : IRegistryEntry
        {
            if (Initialized)
            {
                throw new Exception("A registry must be created before initialization. Add a registry in a coroutine added to `LoadingManager.Inst.InitializeLoaders` with a priority less than 20.");
            }
            var key = typeof(T);

            if (registries.ContainsKey(key))
            {
                throw new ArgumentException(string.Format("A registry for {0} is already created.", key.Name));
            }
            var name     = key.Name;
            var registry = new Registry <T>(name, handler);

            registries.Add(key, registry);
            return(registry);
        }
 public AppearanceService(IRegistryHandler registryHandler)
 {
     _registryHandler = registryHandler;
 }