mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-05 01:51:23 +01:00
refactor: migrate cultures generator (#1287)
* refactor: migrate cultures generator * Update src/modules/cultures-generator.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore:lint * fix: wrong call structure --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
260ccd76a3
commit
3807903cae
6 changed files with 1419 additions and 622 deletions
|
|
@ -8494,7 +8494,6 @@
|
|||
<script defer src="config/heightmap-templates.js"></script>
|
||||
<script defer src="config/precreated-heightmaps.js"></script>
|
||||
<script defer src="modules/ice.js?v=1.111.0"></script>
|
||||
<script defer src="modules/cultures-generator.js?v=1.106.0"></script>
|
||||
<script defer src="modules/burgs-generator.js?v=1.109.5"></script>
|
||||
<script defer src="modules/states-generator.js?v=1.107.0"></script>
|
||||
<script defer src="modules/provinces-generator.js?v=1.106.0"></script>
|
||||
|
|
|
|||
1405
src/modules/cultures-generator.ts
Normal file
1405
src/modules/cultures-generator.ts
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -6,3 +6,4 @@ import "./ocean-layers";
|
|||
import "./lakes";
|
||||
import "./river-generator";
|
||||
import "./biomes";
|
||||
import "./cultures-generator";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import type { Culture } from "../modules/cultures-generator";
|
||||
import type { PackedGraphFeature } from "../modules/features";
|
||||
import type { River } from "../modules/river-generator";
|
||||
|
||||
|
|
@ -19,15 +20,18 @@ export interface PackedGraph {
|
|||
b: boolean[]; // cell is on border
|
||||
h: TypedArray; // cell heights
|
||||
t: TypedArray; // cell terrain types
|
||||
r: Uint16Array; // river id passing through cell
|
||||
f: Uint16Array; // feature id occupying cell
|
||||
r: TypedArray; // river id passing through cell
|
||||
f: TypedArray; // feature id occupying cell
|
||||
fl: TypedArray; // flux presence in cell
|
||||
s: TypedArray; // cell suitability
|
||||
pop: TypedArray; // cell population
|
||||
conf: TypedArray; // cell water confidence
|
||||
haven: TypedArray; // cell is a haven
|
||||
g: number[]; // cell ground type
|
||||
culture: number[]; // cell culture id
|
||||
biome: TypedArray; // cell biome id
|
||||
harbor: TypedArray; // cell harbour presence
|
||||
area: TypedArray; // cell area
|
||||
};
|
||||
vertices: {
|
||||
i: number[]; // vertex indices
|
||||
|
|
@ -39,5 +43,5 @@ export interface PackedGraph {
|
|||
};
|
||||
rivers: River[];
|
||||
features: PackedGraphFeature[];
|
||||
cultures: any[];
|
||||
cultures: Culture[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ declare global {
|
|||
var nameBases: NameBase[];
|
||||
|
||||
var pointsInput: HTMLInputElement;
|
||||
var culturesInput: HTMLInputElement;
|
||||
var culturesSet: HTMLSelectElement;
|
||||
var heightExponentInput: HTMLInputElement;
|
||||
var alertMessage: HTMLElement;
|
||||
var mapName: HTMLInputElement;
|
||||
|
||||
var rivers: Selection<SVGElement, unknown, null, undefined>;
|
||||
|
|
@ -31,6 +34,8 @@ declare global {
|
|||
icons: string[][];
|
||||
cost: number[];
|
||||
};
|
||||
var COA: any;
|
||||
var FlatQueue: any;
|
||||
|
||||
var tip: (
|
||||
message: string,
|
||||
|
|
@ -39,4 +44,5 @@ declare global {
|
|||
) => void;
|
||||
var locked: (settingId: string) => boolean;
|
||||
var unlock: (settingId: string) => void;
|
||||
var $: (selector: any) => any;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue