Class TitleBuilder
- Namespace
- FishMMO.Shared.NameGeneration
- Assembly
- FishMMO.Shared.dll
Template-driven title builder.
A title is a TitleTemplate from the grammar asset with its slots filled from the race's tables (honorifics, epithets, ranks, legends, occupations, places) and the grammar's universal vocabulary (deeds, eras, ordinals…). Templates whose slots cannot be filled for a race are skipped; honorifics only take a place or an ordinal when the grammar says they may; honorifics follow the character's gender; and a length budget decides whether a second clause is appended at all.
Examples: Sir · Lady of Ashford · King, Third of his
Name · the Ironwilled · Master Coinkeeper of Kingshold ·
Who Sealed the Dark Gate at the Battle of Hollow Hill.
public static class TitleBuilder
- Inheritance
-
TitleBuilder
- Inherited Members
Fields
DefaultTemplates
Compositions used when the grammar asset has none, so a bare grammar still yields titles. The same set is what the migration writes into the asset.
public static readonly TitleTemplate[] DefaultTemplates
Field Value
Methods
Build(string, TitleOptions, string, DeterministicRNG, TitleMemory)
Builds a title for a race. Returns empty strings when the race has no titles or nothing fits.
public static (string title, string category) Build(string race, TitleOptions options, string meaning, DeterministicRNG rng, TitleMemory memory = null)
Parameters
racestringoptionsTitleOptionsmeaningstringrngDeterministicRNGmemoryTitleMemory
Returns
TitleCaseObject(string)
"a goddess" → "a Goddess", "the iron gate" → "the Iron Gate": nouns are capitalised, articles and prepositions stay lower, so authored and composed legends read the same.
public static string TitleCaseObject(string s)
Parameters
sstring