88
99namespace InEngine . Core
1010{
11- public class Plugin
11+ public class PluginAssembly
1212 {
1313 public Assembly Assembly { get ; set ; }
1414 public string Name { get { return Assembly . GetName ( ) . Name ; } }
1515 public string Version { get { return Assembly . GetName ( ) . Version . ToString ( ) ; } }
1616
17- public Plugin ( Assembly assembly )
17+ public PluginAssembly ( Assembly assembly )
1818 {
1919 Assembly = assembly ;
2020 }
2121
22- public static Plugin LoadFrom ( string assemblyPath )
22+ public static PluginAssembly LoadFrom ( string assemblyPath )
2323 {
2424 var path = Path . Combine ( InEngineSettings . BasePath , assemblyPath ) ;
2525 try
2626 {
27- return new Plugin ( Assembly . LoadFrom ( path ) ) ;
27+ return new PluginAssembly ( Assembly . LoadFrom ( path ) ) ;
2828 }
2929 catch ( Exception exception )
3030 {
3131 throw new PluginNotFoundException ( $ "Plugin not found at { path } ", exception ) ;
3232 }
3333 }
3434
35- public List < T > Make < T > ( ) where T : class , IPluginType
35+ public List < T > Make < T > ( ) where T : class , IPlugin
3636 {
3737 return Assembly
3838 . GetTypes ( )
@@ -41,12 +41,12 @@ public List<T> Make<T>() where T : class, IPluginType
4141 . ToList ( ) ;
4242 }
4343
44- public static List < Plugin > Load < T > ( ) where T : IPluginType
44+ public static List < PluginAssembly > Load < T > ( ) where T : IPlugin
4545 {
46- var pluginList = new List < Plugin > ( ) ;
46+ var pluginList = new List < PluginAssembly > ( ) ;
4747 try
4848 {
49- pluginList . Add ( new Plugin ( Assembly . GetExecutingAssembly ( ) ) ) ;
49+ pluginList . Add ( new PluginAssembly ( Assembly . GetExecutingAssembly ( ) ) ) ;
5050 }
5151 catch ( Exception exception )
5252 {
@@ -62,7 +62,7 @@ public static List<Plugin> Load<T>() where T : IPluginType
6262 try
6363 {
6464 if ( assembly . GetTypes ( ) . Any ( y => y . IsClass && typeof ( T ) . IsAssignableFrom ( y ) ) )
65- pluginList . Add ( new Plugin ( assembly ) ) ;
65+ pluginList . Add ( new PluginAssembly ( assembly ) ) ;
6666 }
6767 catch ( Exception exception )
6868 {
0 commit comments