SyllableGenerator

Generates syllables that can be sequenced into names.

Implements: ISyllableGenerator, Archigen.IGenerator<System.String>, IRandomizable

Constructors

Constructor
Description

SyllableGenerator()

Instantiates a new SyllableGenerator with no symbol generators.

Methods

Method
Returns
Description

Add(SymbolPosition position, System.String symbols)

Adds symbols to the specified position. Each character in the string is considered a separate symbol.

Add(SymbolPosition position, SymbolGenerator generator)

Adds a SymbolGenerator. The generator's symbols will only be used for the specified position.

Copy()

Creates a deep copy of this SyllableGenerator excluding internal instances of System.Random.

Next()

System.String

Generates a new syllable and returns it as a string.

SetChance(SymbolPosition position, System.Double chance)

Sets the probability of generating a symbol for the specified position. The default value is 1.0 (100% probability) unless changed by calling this method.

Properties

Property
Type
Description

PositionChance

System.Collections.Generic.Dictionary <SymbolPosition,System.Double>

The probability of generating a symbol for a given position. The default value is 1.0 (100%) for each position as long as there are symbols available.

Random

System.Random

The instance of System.Random used to simulate randomness.

SymbolGenerators

System.Collections.Generic.Dictionary <SymbolPosition,System.Collections.Generic.List <SymbolGenerator>>

The symbol generators used to create new syllables.

Last updated