Religions update cultures on culture regeneration

Updated function names to be more similar and more descriptive
This commit is contained in:
Michael DiRienzo 2020-07-09 18:28:59 -04:00
parent 913c9b0f01
commit 6b73387896
3 changed files with 18 additions and 6 deletions

View file

@ -279,6 +279,17 @@
});
}
function updateCultures() {
console.time('updateCulturesForReligions');
pack.religions = pack.religions.map( (religion, index) => {
if(index === 0) {
return religion;
}
return {...religion, culture: pack.cells.culture[religion.center]};
});
console.timeEnd('updateCulturesForReligions');
}
// assign a unique two-letters code (abbreviation)
function getCode(rawName) {
const name = rawName.replace("Old ", ""); // remove Old prefix
@ -350,6 +361,6 @@
return type() + " of the " + generateMeaning();
};
return {generate, add, getDeityName, expandReligions};
return {generate, add, getDeityName, expandReligions, updateCultures};
})));