Skip to content

Commit

Permalink
feat: Add utilities and collection files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Starciad committed Jan 23, 2024
1 parent c6185e2 commit eb6101a
Show file tree
Hide file tree
Showing 4 changed files with 388 additions and 0 deletions.
323 changes: 323 additions & 0 deletions scripts/collections/names/EUANamesCollection.js
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];
},
});
57 changes: 57 additions & 0 deletions scripts/core/dataGenerator.js
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);
}
}
3 changes: 3 additions & 0 deletions scripts/core/pageUpdater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function updateCharacterSheet(characterInfos) {

}
5 changes: 5 additions & 0 deletions scripts/math/random.js
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;
},
});

0 comments on commit eb6101a

Please sign in to comment.