Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions data/culture/culture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ end
-- one is randomly selected according to pre-set weights. Valid input
-- is the same as Culture:Surname.
--
-- > name1, name2 = Culture:Names(isfemale, rand, culture)
-- > first_name, surname, culture = Culture:Names(isfemale, rand, culture)
--
-- Parameters:
--
Expand All @@ -167,21 +167,23 @@ end
--
-- rand - the <Rand> object to use to generate the name
--
-- culture - optional string
-- culture - optional string. Equivalent to the language files parameter 'name'
--
-- Return:
--
-- name1 - a string containing the first name
-- first_name - a string containing the first name
--
-- name2 - a string containing the surname
-- surname - a string containing the surname
--
-- culture - a string containing the language/culture name
--
-- Return full name from the same culture/language

--
-- Return full name and language/culture name, from the same culture/language
-- as separate strings
function Culture:Names (isFemale, rand, culture)
-- if 'culture' given as a string, e.g. "Russian" use that
local c = self.lookup[culture] or utils.chooseNormalized(self.weights, rand).lang
return c:FirstName(isFemale), c:Surname(isFemale)
return c:FirstName(isFemale), c:Surname(isFemale), c.name
end

return Culture
Loading