-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add utilities and collection files.
- Loading branch information
Showing
4 changed files
with
388 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,323 @@ | ||
export const EUANamesCollection = Object.freeze({ | ||
maleNames: [ | ||
"James", | ||
"John", | ||
"Robert", | ||
"Michael", | ||
"William", | ||
"David", | ||
"Richard", | ||
"Joseph", | ||
"Charles", | ||
"Thomas", | ||
"Christopher", | ||
"Daniel", | ||
"Matthew", | ||
"Donald", | ||
"Brian", | ||
"Mark", | ||
"George", | ||
"Steven", | ||
"Edward", | ||
"Paul", | ||
"Kenneth", | ||
"Andrew", | ||
"Joshua", | ||
"Kevin", | ||
"Jeffrey", | ||
"Ryan", | ||
"Jacob", | ||
"Gary", | ||
"Nicholas", | ||
"Eric", | ||
"Stephen", | ||
"Jonathan", | ||
"Larry", | ||
"Justin", | ||
"Scott", | ||
"Brandon", | ||
"Benjamin", | ||
"Samuel", | ||
"Frank", | ||
"Gregory", | ||
"Raymond", | ||
"Alexander", | ||
"Patrick", | ||
"Jack", | ||
"Dennis", | ||
"Jerry", | ||
"Tyler", | ||
"Aaron", | ||
"Henry", | ||
"Douglas", | ||
"Peter", | ||
"Jose", | ||
"Adam", | ||
"Walter", | ||
"Zachary", | ||
"Harold", | ||
"Keith", | ||
"Jeremy", | ||
"Roger", | ||
"Johnny", | ||
"Bobby", | ||
"Dylan", | ||
"Phillip", | ||
"Shawn", | ||
"Jesse", | ||
"Eugene", | ||
"Bradley", | ||
"Ray", | ||
"Russell", | ||
"Alan", | ||
"Micheal", | ||
"Philip", | ||
"Randy", | ||
"Travis", | ||
"Ricky", | ||
"Tony", | ||
"Luis", | ||
"Martin", | ||
"Joe", | ||
"Billy", | ||
"Willie", | ||
"Gabriel", | ||
"Logan", | ||
"Carl", | ||
"Tom", | ||
"Johnny", | ||
"Craig", | ||
"Terry", | ||
"Dean", | ||
"Allen", | ||
"Frederick", | ||
"Eddie", | ||
"Neil", | ||
"Darrell", | ||
"Jerome", | ||
"Leo", | ||
"Victor", | ||
"Cody", | ||
"Milton", | ||
"Alex", | ||
], | ||
femaleNames: [ | ||
"Mary", | ||
"Patricia", | ||
"Jennifer", | ||
"Linda", | ||
"Elizabeth", | ||
"Barbara", | ||
"Susan", | ||
"Jessica", | ||
"Sarah", | ||
"Karen", | ||
"Nancy", | ||
"Lisa", | ||
"Margaret", | ||
"Betty", | ||
"Dorothy", | ||
"Sandra", | ||
"Ashley", | ||
"Kimberly", | ||
"Donna", | ||
"Emily", | ||
"Carol", | ||
"Michelle", | ||
"Amanda", | ||
"Melissa", | ||
"Deborah", | ||
"Stephanie", | ||
"Rebecca", | ||
"Laura", | ||
"Helen", | ||
"Sharon", | ||
"Cynthia", | ||
"Kathleen", | ||
"Amy", | ||
"Shirley", | ||
"Angela", | ||
"Ruth", | ||
"Anna", | ||
"Virginia", | ||
"Brenda", | ||
"Pamela", | ||
"Nicole", | ||
"Catherine", | ||
"Christine", | ||
"Samantha", | ||
"Janet", | ||
"Debra", | ||
"Amanda", | ||
"Carolyn", | ||
"Diana", | ||
"Frances", | ||
"Alice", | ||
"Julie", | ||
"Heather", | ||
"Teresa", | ||
"Doris", | ||
"Gloria", | ||
"Evelyn", | ||
"Jean", | ||
"Cheryl", | ||
"Mildred", | ||
"Katherine", | ||
"Joan", | ||
"Ashley", | ||
"Judith", | ||
"Rose", | ||
"Janice", | ||
"Kelly", | ||
"Nicole", | ||
"Judy", | ||
"Christina", | ||
"Kathy", | ||
"Theresa", | ||
"Beverly", | ||
"Denise", | ||
"Tammy", | ||
"Irene", | ||
"Jane", | ||
"Lori", | ||
"Rachel", | ||
"Marilyn", | ||
"Andrea", | ||
"Kathryn", | ||
"Louise", | ||
"Sara", | ||
"Anne", | ||
"Jacqueline", | ||
"Wanda", | ||
"Bonnie", | ||
"Julia", | ||
"Ruby", | ||
"Lois", | ||
"Tina", | ||
"Phyllis", | ||
"Norma", | ||
"Paula", | ||
"Diana", | ||
"Annie", | ||
"Lillian", | ||
"Emily", | ||
"Linda", | ||
], | ||
lastNames: [ | ||
"Smith", | ||
"Johnson", | ||
"Williams", | ||
"Brown", | ||
"Jones", | ||
"Miller", | ||
"Davis", | ||
"García", | ||
"Rodriguez", | ||
"Martinez", | ||
"Hernandez", | ||
"Lopez", | ||
"Gonzalez", | ||
"Wilson", | ||
"Anderson", | ||
"Thomas", | ||
"Taylor", | ||
"Moore", | ||
"Jackson", | ||
"White", | ||
"Harris", | ||
"Martin", | ||
"Thompson", | ||
"Garcia", | ||
"Martinez", | ||
"Robinson", | ||
"Clark", | ||
"Rodriguez", | ||
"Lewis", | ||
"Lee", | ||
"Walker", | ||
"Hall", | ||
"Allen", | ||
"Young", | ||
"Hernandez", | ||
"King", | ||
"Wright", | ||
"Lopez", | ||
"Hill", | ||
"Scott", | ||
"Green", | ||
"Adams", | ||
"Baker", | ||
"Gonzalez", | ||
"Nelson", | ||
"Carter", | ||
"Mitchell", | ||
"Perez", | ||
"Roberts", | ||
"Turner", | ||
"Phillips", | ||
"Campbell", | ||
"Parker", | ||
"Evans", | ||
"Edwards", | ||
"Collins", | ||
"Stewart", | ||
"Sanchez", | ||
"Morris", | ||
"Rogers", | ||
"Reed", | ||
"Cook", | ||
"Morgan", | ||
"Bell", | ||
"Murphy", | ||
"Bailey", | ||
"Rivera", | ||
"Cooper", | ||
"Richardson", | ||
"Cox", | ||
"Howard", | ||
"Ward", | ||
"Torres", | ||
"Peterson", | ||
"Gray", | ||
"Ramirez", | ||
"James", | ||
"Watson", | ||
"Brooks", | ||
"Kelly", | ||
"Sanders", | ||
"Price", | ||
"Bennett", | ||
"Wood", | ||
"Barnes", | ||
"Ross", | ||
"Henderson", | ||
"Coleman", | ||
"Jenkins", | ||
"Perry", | ||
"Powell", | ||
"Long", | ||
"Patterson", | ||
"Hughes", | ||
"Flores", | ||
"Washington", | ||
"Butler", | ||
"Simmons", | ||
"Foster", | ||
"Gonzales" | ||
], | ||
|
||
getRandomMaleName: function () { | ||
const randomIndex = Math.floor(Math.random() * this.maleNames.length); | ||
return this.maleNames[randomIndex]; | ||
}, | ||
|
||
getRandomFemaleName: function () { | ||
const randomIndex = Math.floor(Math.random() * this.femaleNames.length); | ||
return this.femaleNames[randomIndex]; | ||
}, | ||
|
||
getRandomLastName: function () { | ||
const randomIndex = Math.floor(Math.random() * this.lastNames.length); | ||
return this.lastNames[randomIndex]; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { EUANamesCollection } from "../collections/names/EUANamesCollection.js"; | ||
import { random } from "../math/random.js"; | ||
|
||
export function SCSGenerator(nameStyleType, sexType, ageRangeType) { | ||
let char_fullname = getRandomName(nameStyleType, sexType); | ||
let char_age = getRandomAge(ageRangeType); | ||
} | ||
|
||
function getRandomName(nameStyleType, sexType) { | ||
let firstName; | ||
let lastName; | ||
|
||
switch (nameStyleType) { | ||
case "USA": | ||
if (sexType === "masculine") { | ||
firstName = EUANamesCollection.getRandomMaleName(); | ||
} else if (sexType === "feminine") { | ||
firstName = EUANamesCollection.getRandomFemaleName(); | ||
} | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
|
||
lastName = EUANamesCollection.getRandomLastName(); | ||
|
||
return { | ||
firstName, | ||
lastName | ||
} | ||
} | ||
|
||
function getRandomAge(ageRangeType) { | ||
switch (ageRangeType) { | ||
case "random": | ||
return random.getRandomNumber(0, 100); | ||
|
||
case "child": | ||
return random.getRandomNumber(1, 12); | ||
|
||
case "teenager": | ||
return random.getRandomNumber(13, 19); | ||
|
||
case "youngAdult": | ||
return random.getRandomNumber(20, 35); | ||
|
||
case "adult": | ||
return random.getRandomNumber(36, 60); | ||
|
||
case "elderly": | ||
return random.getRandomNumber(61, 100); | ||
|
||
default: | ||
return random.getRandomNumber(0, 100); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function updateCharacterSheet(characterInfos) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const random = Object.freeze({ | ||
getRandomNumber: function (min, max) { | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
}, | ||
}); |