Пример #1
0
 public PluginManager()
 {
     _plugins = new Dictionary <string, IPlugin>();
     _wrapper = new FileSystem.PathWrapper();
     _path    = _wrapper.GetPathForCurrentOS("data/plugins");
     if (!Directory.Exists(_path))
     {
         Directory.CreateDirectory(_path);
     }
     _watcher          = new FileSystemWatcher(_path);
     _watcher.Changed += PluginsChanged;
     _watcher.Renamed += PluginsRenamed;
     LoadAllPlugins();
 }
Пример #2
0
 public PluginManager()
 {
     _plugins = new Dictionary<string, IPlugin>();
     _wrapper = new FileSystem.PathWrapper();
     _path = _wrapper.GetPathForCurrentOS("data/plugins");
     if (!Directory.Exists(_path))
     {
         Directory.CreateDirectory(_path);
     }
     _watcher = new FileSystemWatcher(_path);
     _watcher.Changed += PluginsChanged;
     _watcher.Renamed += PluginsRenamed;
     LoadAllPlugins();
 }
Пример #3
0
 private void GetAITypes()
 {
     _wrapper = new FileSystem.PathWrapper();
     _path = _wrapper.GetPathForCurrentOS("data/plugins/ki");
     Assembly asm = Assembly.GetExecutingAssembly();
     AITypes = new List<Type>(asm.GetTypes().Where<Type>(t => t.IsSubclassOf(typeof(AI.AbstractAI))));
     if (!Directory.Exists(_path))
     {
         Directory.CreateDirectory(_path);
     }
     else
     {
         GetAITypesFromOuterAssemblie(Directory.GetFiles(_path));
     }
 }
Пример #4
0
        private void GetAITypes()
        {
            _wrapper = new FileSystem.PathWrapper();
            _path    = _wrapper.GetPathForCurrentOS("data/plugins/ki");
            Assembly asm = Assembly.GetExecutingAssembly();

            AITypes = new List <Type>(asm.GetTypes().Where <Type>(t => t.IsSubclassOf(typeof(AI.AbstractAI))));
            if (!Directory.Exists(_path))
            {
                Directory.CreateDirectory(_path);
            }
            else
            {
                GetAITypesFromOuterAssemblie(Directory.GetFiles(_path));
            }
        }