28 lines
884 B
JavaScript
28 lines
884 B
JavaScript
import { SIZE } from "./grid.js";
|
|
|
|
export function createMapFields() {
|
|
const flowTo = new Int32Array(SIZE);
|
|
flowTo.fill(-1);
|
|
|
|
return {
|
|
elevation: new Float32Array(SIZE),
|
|
moisture: new Float32Array(SIZE),
|
|
slope: new Float32Array(SIZE),
|
|
sea: new Uint8Array(SIZE),
|
|
river: new Float32Array(SIZE),
|
|
floodplain: new Float32Array(SIZE),
|
|
plain: new Float32Array(SIZE),
|
|
agriculture: new Float32Array(SIZE),
|
|
ridgeField: new Float32Array(SIZE),
|
|
valleyField: new Float32Array(SIZE),
|
|
basinField: new Float32Array(SIZE),
|
|
coastalLowland: new Float32Array(SIZE),
|
|
flowAccum: new Float32Array(SIZE),
|
|
erosionField: new Float32Array(SIZE),
|
|
depositionField: new Float32Array(SIZE),
|
|
flowTo,
|
|
portSuitability: new Float32Array(SIZE),
|
|
crossingSuitability: new Float32Array(SIZE),
|
|
passSuitability: new Float32Array(SIZE),
|
|
};
|
|
}
|