示例#1
0
        private void CreateComponents(WorldSettings settings)
        {
            ImagesRegistry   = new ImagesRegistry(this);
            ThreadsComponent = new ThreadsCoreComponent(this);

            ModulesStorage    = new ModulesStorageComponent(this);
            StandaloneStorage = new StandaloneStorageComponent(settings, this);
            PlatformTypesConvertorsRegistry = new PlatformTypesConvertorsRegistry(Logger);
            DateTimeProvider        = new DateTimeProvider(Logger, ThreadsComponent);
            LogicQueryParseAndCache = new LogicQueryParseAndCache(settings, this);
        }
示例#2
0
        private void LoadTypesPlatformTypesConvertors()
        {
            var targetAttributeType = typeof(PlatformTypesConvertorAttribute);

            var typesList = AppDomainTypesEnumerator.GetTypes().Where(p => p.GetCustomAttributesData().Any(x => x.AttributeType == targetAttributeType)).ToList();

            foreach (var type in typesList)
            {
                var convertor = (IPlatformTypesConvertor)Activator.CreateInstance(type);

                PlatformTypesConvertorsRegistry.AddConvertor(convertor);
            }
        }
示例#3
0
 public void AddConvertor(IPlatformTypesConvertor convertor)
 {
     PlatformTypesConvertorsRegistry.AddConvertor(convertor);
 }