Members
-
float
mutationChance
— When generating, chance to insert a random character at any point. Defaults to 0.
-
bool
useGeneration
— Whether to use dynamic generation or only pick random names from the list. Defaults to true.
-
bool
preventDuplicates
— Whether to prevent this generator from generating the same name twice. Defaults to false.
void
clear(
)
Clear all internal data, including the name list and mutation chance.
void
read(
string&
filename,
bool
resolve = true
)
Read the list of names from a file.
-
string&
filename — File to read from.
-
bool
resolve — Whether to resolve the file to the mod.
void
write(
string&
filename,
bool
resolve = true
)
Write the list of names to a file.
-
string&
filename — File to write to.
-
bool
resolve — Whether to resolve the file to the mod.
bool
hasName(
string&
name
)
Check whether a name is in the internal name list.
Returns
bool
: Whether it is in the list.
void
addAssociation(
int
first,
int
second,
int
next
)
Add a character association to the markov chance tree.
-
int
first — First unicode character to associate after.
-
int
second — Second unicode character to associate after.
-
int
next — Character that comes after the pair of unicode characters.
string
generate(
)
Generate a new name using this name generator's rules.
Returns
string
: Generated name.