C# Class Supermarket.NameGenerator

Static class that generates names from random syllables.
Datei anzeigen Open project: Clarksj4/Theme-Supermarket-Tycoon-World

Public Methods

Method Description
CapitalizeFirst ( string name ) : string

Capitalizes the first letter of the given string

FirstAndLastName ( ) : string

Generates a name from random syllables. The name includes both a first and last name.

GenerateName ( int minSyllables, int maxSyllables ) : string

Generates a name by concatenating n syllables where: minSyllables < n < maxSyllables

LoadSyllables ( string path ) : string[]

Loads list of syllables from the file at the given path.

Method Details

CapitalizeFirst() public static method

Capitalizes the first letter of the given string
public static CapitalizeFirst ( string name ) : string
name string THe string to capitalize the first letter of
return string

FirstAndLastName() public static method

Generates a name from random syllables. The name includes both a first and last name.
public static FirstAndLastName ( ) : string
return string

GenerateName() public static method

Generates a name by concatenating n syllables where: minSyllables < n < maxSyllables
public static GenerateName ( int minSyllables, int maxSyllables ) : string
minSyllables int The minimum number of syllables to include in the name
maxSyllables int The maximum number of syllables to include in the name
return string

LoadSyllables() public static method

Loads list of syllables from the file at the given path.
public static LoadSyllables ( string path ) : string[]
path string The path to the file that contains the syllables
return string[]