From b3afb100262e33cab8414d93cd672b9c1bab10ad Mon Sep 17 00:00:00 2001 From: kesac Date: Wed, 5 Jun 2024 21:59:20 -0600 Subject: [PATCH] Added fluent-style methods for controlling randomness in SyllableSet and TransformSet --- Syllabore/Syllabore/SyllableSet.cs | 11 +++++++++++ Syllabore/Syllabore/TransformSet.cs | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/Syllabore/Syllabore/SyllableSet.cs b/Syllabore/Syllabore/SyllableSet.cs index e1e2a7b..bb03783 100644 --- a/Syllabore/Syllabore/SyllableSet.cs +++ b/Syllabore/Syllabore/SyllableSet.cs @@ -108,6 +108,17 @@ public SyllableSet WithGenerator(ISyllableGenerator provider) return this; } + + /// + /// Sets the instance of + /// used to simulate randomness during syllable generation. + /// + public SyllableSet WithRandom(Random random) + { + this.Random = random; + return this; + } + /// /// Adds a syllable to this 's pool of starting syllables. /// diff --git a/Syllabore/Syllabore/TransformSet.cs b/Syllabore/Syllabore/TransformSet.cs index d4fdd17..57a489b 100644 --- a/Syllabore/Syllabore/TransformSet.cs +++ b/Syllabore/Syllabore/TransformSet.cs @@ -167,6 +167,16 @@ public TransformSet WithTransform(Func config) return this; } + /// + /// Sets the instance of + /// used to simulate randomness when is true. + /// + public TransformSet WithRandom(Random random) + { + this.Random = random; + return this; + } + /// /// /// Applies a weight to the last added transform that influences the probability of being used over others.