BotNavSim  v0.4.3
Mobile Robot Simulation
NavLoader Class Reference

Used to find and load INavigation implementations from .dll files. More...

Collaboration diagram for NavLoader:

Static Public Member Functions

static void SearchForPlugins ()
 Searchs for plugins in the INavigation directory (Strings.navigationPluginDirectory) Results are stored in pluginsFound. More...
 
static INavigation LoadPlugin (string name)
 Instantiate the INavigation assembly from a given filename (not filepath). More...
 
static INavigation RandomPlugin ()
 Instantiates a random INavigation plugin from any plugin in the INavigation directory. More...
 
static string RandomPluginName ()
 Returns a random filename from the pluginsFound list. More...
 

Static Public Attributes

static List< string > pluginsFound = new List<string>()
 List of .dll files that implement INavigation. More...
 

Static Private Attributes

static PluginFactory< INavigation_loader = new PluginFactory<INavigation>()
 

Detailed Description

Used to find and load INavigation implementations from .dll files.

Definition at line 10 of file NavLoader.cs.

Member Function Documentation

static INavigation NavLoader.LoadPlugin ( string  name)
static

Instantiate the INavigation assembly from a given filename (not filepath).

Returns
The plugin.
Parameters
nameName.

Definition at line 35 of file NavLoader.cs.

35  {
36  if (!name.Contains(".dll")) name += ".dll";
38  }
static PluginFactory< INavigation > _loader
Definition: NavLoader.cs:16
A utility class for strings used in this project.
Definition: Strings.cs:9
T CreatePlugin(string file)
Find and instantiate a type from a specified assembly file (accepts only DLL files) ...
static string navigationPluginDirectory
Gets the navigation plugin directory.
Definition: Strings.cs:60

Here is the call graph for this function:

Here is the caller graph for this function:

static INavigation NavLoader.RandomPlugin ( )
static

Instantiates a random INavigation plugin from any plugin in the INavigation directory.

Returns
The plugin.

Definition at line 44 of file NavLoader.cs.

44  {
46  int index = UnityEngine.Random.Range(0, pluginsFound.Count);
47  return LoadPlugin(pluginsFound[index]);
48  }
static void SearchForPlugins()
Searchs for plugins in the INavigation directory (Strings.navigationPluginDirectory) Results are stor...
Definition: NavLoader.cs:22
static List< string > pluginsFound
List of .dll files that implement INavigation.
Definition: NavLoader.cs:15
static INavigation LoadPlugin(string name)
Instantiate the INavigation assembly from a given filename (not filepath).
Definition: NavLoader.cs:35

Here is the call graph for this function:

static string NavLoader.RandomPluginName ( )
static

Returns a random filename from the pluginsFound list.

Returns
The plugin name.

Definition at line 54 of file NavLoader.cs.

54  {
56  int index = UnityEngine.Random.Range(0, pluginsFound.Count);
57  return pluginsFound[index];
58  }
static void SearchForPlugins()
Searchs for plugins in the INavigation directory (Strings.navigationPluginDirectory) Results are stor...
Definition: NavLoader.cs:22
static List< string > pluginsFound
List of .dll files that implement INavigation.
Definition: NavLoader.cs:15

Here is the call graph for this function:

Here is the caller graph for this function:

static void NavLoader.SearchForPlugins ( )
static

Searchs for plugins in the INavigation directory (Strings.navigationPluginDirectory) Results are stored in pluginsFound.

Definition at line 22 of file NavLoader.cs.

22  {
23  pluginsFound.Clear();
24  if (!Directory.Exists(Strings.navigationPluginDirectory))
25  Directory.CreateDirectory(Strings.navigationPluginDirectory);
27  Debug.Log ("Found " + pluginsFound.Count + " plugins at " + Strings.navigationPluginDirectory);
28  }
List< string > ListPlugins(string path)
Lists assembly (DLL) file names that implement the type T.
static PluginFactory< INavigation > _loader
Definition: NavLoader.cs:16
static List< string > pluginsFound
List of .dll files that implement INavigation.
Definition: NavLoader.cs:15
A utility class for strings used in this project.
Definition: Strings.cs:9
static string navigationPluginDirectory
Gets the navigation plugin directory.
Definition: Strings.cs:60

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

PluginFactory<INavigation> NavLoader._loader = new PluginFactory<INavigation>()
staticprivate

Definition at line 16 of file NavLoader.cs.

List<string> NavLoader.pluginsFound = new List<string>()
static

List of .dll files that implement INavigation.

Definition at line 15 of file NavLoader.cs.


The documentation for this class was generated from the following file: