mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Syntax / Typo
This commit is contained in:
parent
2976480cfc
commit
53cb2ed342
2 changed files with 9 additions and 10 deletions
|
|
@ -832,7 +832,7 @@ function recalculateReligions(must) {
|
||||||
Religions.resetUnlockedReligions();
|
Religions.resetUnlockedReligions();
|
||||||
Religions.expandReligions();
|
Religions.expandReligions();
|
||||||
Religions.expandHeresies();
|
Religions.expandHeresies();
|
||||||
Religions.checkReligionCentres();
|
Religions.checkReligionCenters();
|
||||||
|
|
||||||
drawReligions();
|
drawReligions();
|
||||||
refreshReligionsEditor();
|
refreshReligionsEditor();
|
||||||
|
|
|
||||||
|
|
@ -569,13 +569,12 @@ window.Religions = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
// growth algorithm to assign cells to religions
|
// growth algorithm to assign cells to religions
|
||||||
const expandReligions = function() {
|
function expandReligions() {
|
||||||
const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p});
|
const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p});
|
||||||
const cost = [];
|
const cost = [];
|
||||||
const religionIds = pack.cells.religion;
|
const religionIds = pack.cells.religion;
|
||||||
const cells = pack.cells;
|
const cells = pack.cells;
|
||||||
|
|
||||||
|
|
||||||
pack.religions
|
pack.religions
|
||||||
.filter(r => !r.lock && (r.type === "Organized" || r.type === "Cult"))
|
.filter(r => !r.lock && (r.type === "Organized" || r.type === "Cult"))
|
||||||
.forEach(r => {
|
.forEach(r => {
|
||||||
|
|
@ -614,10 +613,10 @@ window.Religions = (function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// growth algorithm to assign cells to heresies
|
// growth algorithm to assign cells to heresies
|
||||||
const expandHeresies = function() {
|
function expandHeresies() {
|
||||||
const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p});
|
const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p});
|
||||||
const cost = [];
|
const cost = [];
|
||||||
const religionIds = pack.cells.religion;
|
const religionIds = pack.cells.religion;
|
||||||
|
|
@ -655,9 +654,9 @@ window.Religions = (function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
const checkReligionCenters = function() {
|
function checkReligionCenters() {
|
||||||
const codes = pack.religions.map(r => r.code);
|
const codes = pack.religions.map(r => r.code);
|
||||||
pack.religions.forEach(r => {
|
pack.religions.forEach(r => {
|
||||||
if (!r.i) return;
|
if (!r.i) return;
|
||||||
|
|
@ -668,7 +667,7 @@ window.Religions = (function () {
|
||||||
const firstCell = pack.cells.i.find(i => pack.cells.religion[i] === r.i);
|
const firstCell = pack.cells.i.find(i => pack.cells.religion[i] === r.i);
|
||||||
if (firstCell) r.center = firstCell; // move center, othervise it's an extinct religion
|
if (firstCell) r.center = firstCell; // move center, othervise it's an extinct religion
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
const add = function (center) {
|
const add = function (center) {
|
||||||
const {cells, religions} = pack;
|
const {cells, religions} = pack;
|
||||||
|
|
@ -810,7 +809,7 @@ window.Religions = (function () {
|
||||||
const culture = pack.cells.culture;
|
const culture = pack.cells.culture;
|
||||||
// ignore cultures added since last folk generation. Known Issue
|
// ignore cultures added since last folk generation. Known Issue
|
||||||
let knownFolk = 1;
|
let knownFolk = 1;
|
||||||
for(const j = 1; j++; j<pack.religions.length){
|
for(let j = 1; j++; j<pack.religions.length){
|
||||||
if(pack.religions[j].type != "Folk"){
|
if(pack.religions[j].type != "Folk"){
|
||||||
knownFolk = j;
|
knownFolk = j;
|
||||||
break;
|
break;
|
||||||
|
|
@ -823,5 +822,5 @@ window.Religions = (function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {generate, expandReligions, expandHeresies, checkReligionCentres, add, getDeityName, updateCultures, resetUnlockedReligions};
|
return {generate, expandReligions, expandHeresies, checkReligionCenters, add, getDeityName, updateCultures, resetUnlockedReligions};
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue