Class NameGrammar
- Namespace
- FishMMO.Shared.NameGeneration
- Assembly
- FishMMO.Shared.dll
The active NameGrammarTemplate, exposed as runtime lookups. The meaning tables that are scanned for a prefix or suffix match are kept in authored order (first match wins, exactly as authored); the exact-match tables are dictionaries.
public static class NameGrammar
- Inheritance
-
NameGrammar
- Inherited Members
Properties
BattleQualifiers
public static string[] BattleQualifiers { get; }
Property Value
- string[]
BiomeMeaningCodas
public static IReadOnlyList<StringMapping> BiomeMeaningCodas { get; }
Property Value
BiomeMeaningOnsets
public static IReadOnlyList<StringMapping> BiomeMeaningOnsets { get; }
Property Value
CityPrefixes
public static string[] CityPrefixes { get; }
Property Value
- string[]
CitySuffixMeanings
public static IReadOnlyDictionary<string, string> CitySuffixMeanings { get; }
Property Value
ComposedAdjectives
public static string[] ComposedAdjectives { get; }
Property Value
- string[]
ComposedQualifiers
public static string[] ComposedQualifiers { get; }
Property Value
- string[]
Current
The template currently supplying the grammar, or null.
public static NameGrammarTemplate Current { get; }
Property Value
DeedObjects
public static string[] DeedObjects { get; }
Property Value
- string[]
DeedVerbs
public static string[] DeedVerbs { get; }
Property Value
- string[]
EraQualifiers
public static string[] EraQualifiers { get; }
Property Value
- string[]
FallbackCitySuffixes
public static string[] FallbackCitySuffixes { get; }
Property Value
- string[]
GenericOccupations
public static string[] GenericOccupations { get; }
Property Value
- string[]
IsLoaded
True once a grammar template has been registered.
public static bool IsLoaded { get; }
Property Value
ItemEpithets
public static string[] ItemEpithets { get; }
Property Value
- string[]
ItemGenericNouns
public static string[] ItemGenericNouns { get; }
Property Value
- string[]
ItemHeroRelations
public static string[] ItemHeroRelations { get; }
Property Value
- string[]
ItemLegendaryPrefixes
public static string[] ItemLegendaryPrefixes { get; }
Property Value
- string[]
ItemPlaceRelations
public static string[] ItemPlaceRelations { get; }
Property Value
- string[]
ItemTypeNouns
public static IReadOnlyDictionary<string, string[]> ItemTypeNouns { get; }
Property Value
ItemTypeSuffixes
public static IReadOnlyDictionary<string, string[]> ItemTypeSuffixes { get; }
Property Value
MeaningCodas
public static IReadOnlyList<StringMapping> MeaningCodas { get; }
Property Value
MeaningMiddles
public static IReadOnlyDictionary<string, string> MeaningMiddles { get; }
Property Value
MeaningOnsets
public static IReadOnlyList<StringMapping> MeaningOnsets { get; }
Property Value
MeaningTitleBias
public static IReadOnlyList<StringMapping> MeaningTitleBias { get; }
Property Value
OrdinalTakingHonorifics
public static HashSet<string> OrdinalTakingHonorifics { get; }
Property Value
Ordinals
public static string[] Ordinals { get; }
Property Value
- string[]
Outcomes
public static string[] Outcomes { get; }
Property Value
- string[]
POITypeSuffixes
public static IReadOnlyDictionary<string, string[]> POITypeSuffixes { get; }
Property Value
PlaceEpithetPatterns
public static string[] PlaceEpithetPatterns { get; }
Property Value
- string[]
PlaceTakingHonorifics
public static HashSet<string> PlaceTakingHonorifics { get; }
Property Value
PossessivePronouns
public static string[] PossessivePronouns { get; }
Property Value
- string[]
TitleTemplates
public static IReadOnlyList<TitleTemplate> TitleTemplates { get; }
Property Value
UniversalPlaces
public static string[] UniversalPlaces { get; }
Property Value
- string[]
Methods
Clear()
Drops the active grammar.
public static void Clear()
MatchPrefix(IReadOnlyList<StringMapping>, string)
First row whose key the text starts with, or null. Case-insensitive.
public static string MatchPrefix(IReadOnlyList<StringMapping> rows, string text)
Parameters
rowsIReadOnlyList<StringMapping>textstring
Returns
MatchSuffix(IReadOnlyList<StringMapping>, string)
First row whose key the text ends with, or null. Case-insensitive.
public static string MatchSuffix(IReadOnlyList<StringMapping> rows, string text)
Parameters
rowsIReadOnlyList<StringMapping>textstring
Returns
Rebuild()
Rebuilds every lookup from Current; call after editing it at runtime.
public static void Rebuild()
Register(NameGrammarTemplate)
Makes a template the active grammar. The last one registered wins.
public static void Register(NameGrammarTemplate template)
Parameters
templateNameGrammarTemplate
Unregister(NameGrammarTemplate)
Drops the active grammar, but only if it is still the given template.
public static void Unregister(NameGrammarTemplate template)
Parameters
templateNameGrammarTemplate
Events
Changed
Raised when the active grammar changes.
public static event Action Changed