Пример #1
0
        public StageCache(BuildEngine engine)
        {
            Engine      = engine;
            _importers  = new Dictionary <string, ImporterType>();
            _processors = new Dictionary <string, ProcessorType>();

            // Add the builtin importers
            // TODO: This list must be updated whenever new builtin stages are added, or else they wont appear
            _importers.Add(nameof(PassthroughImporter), ImporterType.TryCreate(engine, typeof(PassthroughImporter)));
            _importers.Add(nameof(TextureImporter), ImporterType.TryCreate(engine, typeof(TextureImporter)));
            _importers.Add(nameof(AudioImporter), ImporterType.TryCreate(engine, typeof(AudioImporter)));

            // Add the builtin processors
            // TODO: This list must be updated whenever new builtin stages are added, or else they wont appear
            _processors.Add(nameof(PassthroughProcessor), ProcessorType.TryCreate(engine, typeof(PassthroughProcessor)));
            _processors.Add(nameof(TextureProcessor), ProcessorType.TryCreate(engine, typeof(TextureProcessor)));
            _processors.Add(nameof(AudioProcessor), ProcessorType.TryCreate(engine, typeof(AudioProcessor)));
        }
Пример #2
0
        public void AddAssemblyTypes(Assembly asm)
        {
            ImporterType  itype = null;
            ProcessorType ptype = null;

            foreach (var type in asm.GetTypes())
            {
                itype = ImporterType.TryCreate(Engine, type);
                if (itype != null)
                {
                    _importers.Add(itype.TypeName, itype);
                }
                else
                {
                    ptype = ProcessorType.TryCreate(Engine, type);
                    if (ptype != null)
                    {
                        _processors.Add(ptype.TypeName, ptype);
                    }
                }
            }
        }
Пример #3
0
 public ImporterInstance(ImporterType type)
 {
     Type     = type;
     Instance = type.CreateInstance();
 }