TransformSet

A TransformSet takes a source name, applies one or more Transform, then creates a new name. By default, all Transform of the same set are applied to the source name and in the order they were added. To randomize what transforms are applied, call Syllabore.TransformSet.RandomlySelect when configuring a TransformSet.

Implements: IPotentialAction, INameTransformer, IRandomizable

Constructors

Constructor
Description

TransformSet()

Instantiates a new TransformSet. By default, all future Transforms that are added to this set will be used in the order they were added unless there is a call to Syllabore.TransformSet.RandomlySelect.

Methods

Method
Returns
Description

Add(Transform transform)

Adds a new Transform to this TransformSet.

Apply(Name sourceName)

Returns a new Name that is the result of one or more Transforms applied to the specified source Name. This method leaves the source Name untouched. This method can result in no changes if Syllabore.TransformSet.Chance is less than 1.0.

Join(TransformSet set)

Combines this TransformSet with the specified TransformSet. A new TransformSet that is the combination of the two is returned.

RandomlySelect(System.Int32 limit)

Sets this TransformSet to randomly select transforms to apply to the source name. The parameter specifies the maximum number of unique transforms that will be applied.

Properties

Property
Type
Description

Chance

System.Double

The probability this transform set will make changes to a name. This value must be between 0 and 1 inclusive. Note that each Transform in the set can also have its own chance value which is rolled separately.

Random

System.Random

Used to simulate randomness when Syllabore.TransformSet.UseRandomSelection is true.

RandomSelectionCount

System.Int32

When Syllabore.TransformSet.UseRandomSelection is true, this property is used to determine how many random Transform are selected and applied.

Transforms

System.Collections.Generic.List <Transform>

The Transform that make up this TransformSet.

UseRandomSelection

System.Boolean

When true, Transform are not applied in the order they were added. Instead, a random number of Transform are selected and applied. Property Syllabore.TransformSet.RandomSelectionCount is used to determine how many random selections are made.

Last updated