diff --git a/index.html b/index.html index 0d6b22e8..daa363a6 100644 --- a/index.html +++ b/index.html @@ -8395,6 +8395,10 @@ + + + + diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index 1161fd63..8045772a 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -887,7 +887,6 @@ window.BurgsAndStates = (() => { state.salesTax = maxTax ? rn(Math.random() * maxTax, 2) : 0; } }; - return { generate, expandStates, @@ -906,8 +905,6 @@ window.BurgsAndStates = (() => { defineTaxes, updateCultures, getCloseToEdgePoint, - defineTaxes, - generateProvinces, - updateCultures + defineTaxes }; -})(); +})(); \ No newline at end of file diff --git a/modules/production-generator.js b/modules/production-generator.js index 9f707c3b..9418aecd 100644 --- a/modules/production-generator.js +++ b/modules/production-generator.js @@ -66,7 +66,7 @@ window.Production = (function () { cells.h[cell] >= 50 && HILLS_PRODUCTION.forEach(({resource, production}) => addResource(resource, production)); } - const queue = new PriorityQueue({comparator: (a, b) => b.priority - a.priority}); + const queue = new FlatQueue(); for (const resourceId in resourcesPull) { const baseProduction = resourcesPull[resourceId]; const resource = Resources.get(+resourceId); @@ -79,7 +79,7 @@ window.Production = (function () { const basePriority = production * value; const priority = basePriority * (isFood ? FOOD_MULTIPLIER : 1); - queue.queue({resourceId: +resourceId, basePriority, priority, production, isFood}); + queue.push({resourceId: +resourceId, basePriority, priority, production, isFood},0); } let foodProduced = 0; @@ -90,7 +90,7 @@ window.Production = (function () { }; for (let i = 0; i < population; i++) { - const occupation = queue.dequeue(); + const occupation = queue.pop(); const {resourceId, production, basePriority, isFood} = occupation; addProduction(resourceId, production); if (isFood) foodProduced += production; @@ -99,7 +99,7 @@ window.Production = (function () { const newBasePriority = basePriority / 2; const newPriority = newBasePriority * foodModifier; - queue.queue({...occupation, basePriority: newBasePriority, priority: newPriority}); + queue.push({...occupation, basePriority: newBasePriority, priority: newPriority},0); } burg.produced = {};