Class InitializationMethodManager
Singleton class that uses reflection to manage all initialization methods, providing an interface to access their names and parameters and to execute them to initialize the system.
Inheritance
Namespace: AS2
Assembly: .dll
Syntax
public class InitializationMethodManager
Constructors
| Edit this page View SourceInitializationMethodManager()
Declaration
public InitializationMethodManager()
Fields
| Edit this page View SourceGenerationMethodName
Declaration
private static readonly string GenerationMethodName
Field Value
| Type | Description |
|---|---|
| string |
algorithms
Declaration
private Dictionary<string, InitializationMethodManager.AlgorithmInfo> algorithms
Field Value
| Type | Description |
|---|---|
| Dictionary<string, InitializationMethodManager.AlgorithmInfo> |
instance
Declaration
private static InitializationMethodManager instance
Field Value
| Type | Description |
|---|---|
| InitializationMethodManager |
Properties
| Edit this page View SourceInstance
The singleton instance of this class.
Declaration
public static InitializationMethodManager Instance { get; }
Property Value
| Type | Description |
|---|---|
| InitializationMethodManager |
Methods
| Edit this page View SourceFindAlgorithm(string)
Tries to get the generation method with the given name.
Declaration
private InitializationMethodManager.AlgorithmInfo FindAlgorithm(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The string ID of the generation method. |
Returns
| Type | Description |
|---|---|
| InitializationMethodManager.AlgorithmInfo | The record of the generation method with name
|
GenerateSystem(ParticleSystem, string)
Calls the specified generation method to initialize the given system with no parameters.
Declaration
public bool GenerateSystem(ParticleSystem system, string algorithmName)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system | The system to initialize. |
| string | algorithmName | The string ID of the generation method. |
Returns
| Type | Description |
|---|---|
| bool |
|
GenerateSystem(ParticleSystem, string, object[])
Calls the specified generation method to initialize the given system with the given parameters.
Declaration
public bool GenerateSystem(ParticleSystem system, string algorithmName, object[] parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system | The system to initialize. |
| string | algorithmName | The string ID of the generation method. |
| object[] | parameters | The parameters to be forwarded to the generation method. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetAlgorithmNames()
Gets a list of all known generation method names.
Declaration
public List<string> GetAlgorithmNames()
Returns
| Type | Description |
|---|---|
| List<string> | A list containing the names of all generation methods. |
GetAlgorithmParameters(string)
Gets the parameters of the generation method.
Declaration
public ParameterInfo[] GetAlgorithmParameters(string algorithmName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | algorithmName | The string ID of the generation method. |
Returns
| Type | Description |
|---|---|
| ParameterInfo[] | An array containing the parameters of the
generation method, if the algorithm exists and
it implements this method, otherwise |
IsAlgorithmKnown(string)
Checks if the given generation method name is known.
Declaration
public bool IsAlgorithmKnown(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The string ID to check. |
Returns
| Type | Description |
|---|---|
| bool |
|