mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +01:00
Religions update cultures on culture regeneration
Updated function names to be more similar and more descriptive
This commit is contained in:
parent
913c9b0f01
commit
6b73387896
3 changed files with 18 additions and 6 deletions
|
|
@ -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};
|
||||
|
||||
})));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue