mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
replace old iife by a simpler ones
This commit is contained in:
parent
37e5b803bc
commit
460bb29e49
15 changed files with 2430 additions and 1313 deletions
|
|
@ -1,14 +1,9 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === "object" && typeof module !== "undefined" ? (module.exports = factory()) : typeof define === "function" && define.amd ? define(factory) : (global.Routes = factory());
|
||||
})(this, function () {
|
||||
"use strict";
|
||||
|
||||
window.Routes = (function () {
|
||||
const getRoads = function () {
|
||||
TIME && console.time("generateMainRoads");
|
||||
const cells = pack.cells;
|
||||
const burgs = pack.burgs.filter(b => b.i && !b.removed);
|
||||
const capitals = burgs.filter(b => b.capital)
|
||||
.sort((a,b) => a.population - b.population);
|
||||
const capitals = burgs.filter(b => b.capital).sort((a, b) => a.population - b.population);
|
||||
|
||||
if (capitals.length < 2) return []; // not enough capitals to build main roads
|
||||
const paths = []; // array to store path segments
|
||||
|
|
@ -271,4 +266,4 @@
|
|||
}
|
||||
return [from, exit, false];
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue