refactor: migrate burg module (#1288)
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
Code quality / quality (push) Has been cancelled

* refactor: migrate burg module

* Update src/modules/burgs-generator.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: lint

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Marc Emmanuel 2026-01-28 00:11:22 +01:00 committed by GitHub
parent 3807903cae
commit e938bc7802
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 755 additions and 598 deletions

View file

@ -1,3 +1,4 @@
import type { Burg } from "../modules/burgs-generator";
import type { Culture } from "../modules/cultures-generator";
import type { PackedGraphFeature } from "../modules/features";
import type { River } from "../modules/river-generator";
@ -31,6 +32,9 @@ export interface PackedGraph {
culture: number[]; // cell culture id
biome: TypedArray; // cell biome id
harbor: TypedArray; // cell harbour presence
burg: TypedArray; // cell burg id
religion: TypedArray; // cell religion id
state: number[]; // cell state id
area: TypedArray; // cell area
};
vertices: {
@ -43,5 +47,7 @@ export interface PackedGraph {
};
rivers: River[];
features: PackedGraphFeature[];
burgs: Burg[];
states: any[];
cultures: Culture[];
}

View file

@ -11,8 +11,13 @@ declare global {
var TIME: boolean;
var WARN: boolean;
var ERROR: boolean;
var options: any;
var heightmapTemplates: any;
var Routes: any;
var populationRate: number;
var urbanDensity: number;
var urbanization: number;
var nameBases: NameBase[];
var pointsInput: HTMLInputElement;
@ -24,6 +29,7 @@ declare global {
var rivers: Selection<SVGElement, unknown, null, undefined>;
var oceanLayers: Selection<SVGGElement, unknown, null, undefined>;
var emblems: Selection<SVGElement, unknown, null, undefined>;
var biomesData: {
i: number[];
name: string[];
@ -35,6 +41,14 @@ declare global {
cost: number[];
};
var COA: any;
var notes: any[];
var layerIsOn: (layerId: string) => boolean;
var drawRoute: (route: any) => void;
var drawBurgIcon: (burg: any) => void;
var drawBurgLabel: (burg: any) => void;
var removeBurgIcon: (burg: any) => void;
var removeBurgLabel: (burg: any) => void;
var FlatQueue: any;
var tip: (