Transform
Last updated
Last updated
A is a mechanism for changing a source name into a new, modified name. Transforming names is useful for adding some determinism in name generation or for creating iterations on an established name. can have an optional condition that must be fulfilled for a transformation to occur.
Implements: , Archigen.IWeighted, ,
Transform()
Instantiates a new . By default, a has no optional condition and a weight of 1.
AddStep( step)
Adds a new step to this transform.
Apply( name)
Applies this on the specified and returns a new as a result. The transform may result in no changes if a condition was added and is not met, or if the ** property is between 0 and 1 exclusive (less than 100%). This method leaves the source unchanged.
Modify( name)
System.Void
Applies this on the specified in a destructive manner. For a non-destructive alternative, use Syllabore.Transform.Apply instead. The transform may result in no changes if a condition was added and is not met, or if the ** property is between 0 and 1 exclusive (less than 100%).
Chance
System.Double
The probability this will attempt to change a name when Syllabore.Transform.Apply is called. The value must be a double between 0 and 1 inclusive. Note that each in this can also have its own chance value.
ConditionalIndex
System.Nullable <System.Int32>
The index of the syllable that the condition operates on. A negative index can be provided to traverse right-to-left from the end of the name instead.
ConditionalRegex
System.String
A regular expression that must be satisfied for the transform to be applied.
Random
System.Random
Used to simulate randomness.
Steps
System.Collections.Generic.List <>
The that this transform will execute.
Weight
System.Int32
A positive integer that influences the probability of this transform being used over others. Given two transforms X and Y with a weight of 3 and 1 respectively, transform X will be applied 75% of the time. All transforms default to a weight of 1.