# NameGenerator

Generates names by constructing syllables and joining them together.

_Implements: Archigen.IGenerator\<System.String>,_ [_IRandomizable_](irandomizable)

## Constructors

| Constructor                                                                                       | Description                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NameGenerator()                                                                                   | Initializes a new instance of the [NameGenerator](namegenerator) class with no symbols, no transformer, and no filter.                                                                                                                                                                 |
| NameGenerator(System.String firstSymbols, System.String middleSymbols)                            | Initializes a new [NameGenerator](namegenerator) with specified symbol pools for the first and middle symbol positions of a syllable. Each character in the provided strings is considered a separate symbol. The generated syllables will be used for all positions of a name.        |
| NameGenerator(System.String firstSymbols, System.String middleSymbols, System.String lastSymbols) | Initializes a new [NameGenerator](namegenerator) with specified symbol pools for the first, middle, and last symbol positions of a syllable. Each character in the provided strings is considered a separate symbol. The generated syllables will be used for all positions of a name. |

## Methods

| Method                                                                                                          | Returns                        | Description                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Next()                                                                                                          | System.String                  | Generates a name and returns it as a string.                                                                                                      |
| SetFilter([INameFilter](inamefilter) filter)                                                                    | [NameGenerator](namegenerator) | Sets the name filter to use when generating names. Returns this instance of [NameGenerator](namegenerator) for chaining.                          |
| SetSize(System.Int32 size)                                                                                      | [NameGenerator](namegenerator) | Sets both the minimum and maximum number of syllables to use per name. Returns this instance of [NameGenerator](namegenerator) for chaining.      |
| SetSize(System.Int32 minSize, System.Int32 maxSize)                                                             | [NameGenerator](namegenerator) | Sets the minimum and maximum number of syllables to use per name. Returns this instance of [NameGenerator](namegenerator) for chaining.           |
| SetSyllables([SyllablePosition](syllableposition) position, [ISyllableGenerator](isyllablegenerator) generator) | [NameGenerator](namegenerator) | Sets the [SyllableGenerator](syllablegenerator) for the specified position. Returns this instance of [NameGenerator](namegenerator) for chaining. |
| SetTransform([INameTransformer](inametransformer) transformer)                                                  | [NameGenerator](namegenerator) | Sets the name transformer to use when generating names. Returns this instance of [NameGenerator](namegenerator) for chaining.                     |

## Properties

| Property           | Type                                                                                                                  | Description                                                                                                                                                                                  |
| ------------------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MaximumRetries     | System.Int32                                                                                                          | If this generator has a filter, this is the maximum attempts that will be made to satisfy the filter before an InvalidOperationException is thrown. The default maximum retry count is 1000. |
| MaximumSize        | System.Int32                                                                                                          | The maximum number of syllables in generated names. The default maximum size is 3 syllables.                                                                                                 |
| MinimumSize        | System.Int32                                                                                                          | The minimum number of syllables in generated names. The default minimum size is 2 syllables.                                                                                                 |
| NameFilter         | [INameFilter](inamefilter)                                                                                            | The filter used to control generated names. Can be null if no filter is being used.                                                                                                          |
| NameTransformer    | [INameTransformer](inametransformer)                                                                                  | The transformer used to modify generated names. Can be null if no transform is being used.                                                                                                   |
| Random             | System.Random                                                                                                         | The instance of _System.Random_ used to simulate randomness.                                                                                                                                 |
| SyllableGenerators | System.Collections.Generic.Dictionary <[SyllablePosition](syllableposition),[ISyllableGenerator](isyllablegenerator)> | The [SyllableGenerator](syllablegenerator) used by this [NameGenerator](namegenerator).                                                                                                      |
