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.
Namespace: AS2
Assembly: .dll
Syntax
public class InitializationMethodManager
Constructors
InitializationMethodManager()
Declaration
public InitializationMethodManager()
Fields
GenerationMethodName
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
Instance
The singleton instance of this class.
Declaration
public static InitializationMethodManager Instance { get; }
Property Value
Type | Description |
---|---|
InitializationMethodManager |
Methods
FindAlgorithm(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 |
|