chore(engine-ts): 🔧 Update TypeScript build configuration for engine dependencies
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
ca5084f6ca
commit
c699aed0ad
4 changed files with 57 additions and 52 deletions
|
|
@ -600,63 +600,71 @@ export class ClimatePhysics {
|
|||
}
|
||||
|
||||
private stepTerrainEvolution(grid: GridState): void {
|
||||
const { tiles } = grid
|
||||
const up_thresh = this.p('quality_up_threshold', 10)
|
||||
const down_thresh = this.p('quality_down_threshold', 5)
|
||||
const { tiles, width: w, height: h } = grid
|
||||
let up_thresh = Math.floor((this.params as any)["quality_up_threshold"] ?? 10)
|
||||
let down_thresh = Math.floor((this.params as any)["quality_down_threshold"] ?? 5)
|
||||
|
||||
for (let i = 0; i < tiles.length; i++) {
|
||||
const tile = tiles[i]
|
||||
const tid = tile.biome_id
|
||||
for (let i = 0; i < tiles.length; i++) {
|
||||
const tile = tiles[i]
|
||||
const { col, row } = tile
|
||||
let tid = tile.biome_id
|
||||
|
||||
if (tile.is_natural_wonder) continue
|
||||
if (tile.is_natural_wonder) {
|
||||
continue
|
||||
|
||||
// Water freezing/thawing — ice forms below freeze threshold, thaws above
|
||||
const freezeTemp = this.p('water_freeze_threshold', 0.12)
|
||||
const thawTemp = freezeTemp + 0.03 // hysteresis prevents oscillation
|
||||
const isWater = tid === 'ocean' || tid === 'coast' || tid === 'lake' || tid === 'inland_sea'
|
||||
if (isWater) {
|
||||
if (tile.temperature < freezeTemp) {
|
||||
tile.original_biome_id = tid
|
||||
tile.biome_id = 'ice'
|
||||
}
|
||||
// Water freezing/thawing
|
||||
let freeze_temp = (this.params as any)["water_freeze_threshold"] ?? 0.12
|
||||
let thaw_temp = freeze_temp + 0.03
|
||||
let is_water = ( tid === "ocean" || tid === "coast" || tid === "lake" || tid === "inland_sea" )
|
||||
if (is_water) {
|
||||
if (tile.temperature < freeze_temp) {
|
||||
tile.original_biome_id = tid
|
||||
tile.biome_id = "ice"
|
||||
tile.quality = 1
|
||||
tile.quality_progress = 0
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (tid === "ice") {
|
||||
if (tile.temperature > thaw_temp && tile.original_biome_id !== "") {
|
||||
tile.biome_id = tile.original_biome_id
|
||||
tile.original_biome_id = ""
|
||||
tile.quality = 1
|
||||
tile.quality_progress = 0
|
||||
}
|
||||
continue
|
||||
|
||||
}
|
||||
if (tid === "volcano") {
|
||||
continue
|
||||
|
||||
}
|
||||
let ideal = idealTerrain(tile, this.spec)
|
||||
|
||||
if (ideal === tid) {
|
||||
tile.quality_progress += 1
|
||||
if (tile.quality_progress >= up_thresh) {
|
||||
tile.quality_progress = 0
|
||||
if (tile.quality < 5) {
|
||||
tile.quality += 1
|
||||
} else {
|
||||
tile.quality_progress -= 1
|
||||
if (tile.quality_progress <= -down_thresh) {
|
||||
tile.quality_progress = 0
|
||||
if (tile.quality > 1) {
|
||||
tile.quality -= 1
|
||||
} else {
|
||||
tile.biome_id = ideal
|
||||
tile.quality = 1
|
||||
tile.quality_progress = 0
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (tid === 'ice') {
|
||||
if (tile.temperature > thawTemp && tile.original_biome_id) {
|
||||
tile.biome_id = tile.original_biome_id
|
||||
tile.original_biome_id = ''
|
||||
tile.quality = 1
|
||||
tile.quality_progress = 0
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if (tid === 'volcano') continue
|
||||
|
||||
const ideal = idealTerrain(tile, this.spec)
|
||||
|
||||
if (ideal === tid) {
|
||||
tile.quality_progress += 1
|
||||
if (tile.quality_progress >= up_thresh) {
|
||||
tile.quality_progress = 0
|
||||
if (tile.quality < 5) tile.quality += 1
|
||||
}
|
||||
} else {
|
||||
tile.quality_progress -= 1
|
||||
if (tile.quality_progress <= -down_thresh) {
|
||||
tile.quality_progress = 0
|
||||
if (tile.quality > 1) {
|
||||
tile.quality -= 1
|
||||
} else {
|
||||
tile.biome_id = ideal
|
||||
tile.quality = 1
|
||||
tile.quality_progress = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private stepGlobalStats(grid: GridState): void {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -183,7 +183,7 @@ METHOD_MAP = [
|
|||
("_update_lake_evaporation", "stepLakeEvaporation", "private"),
|
||||
("_update_deep_earth_water", "stepDeepEarthWater", "private"),
|
||||
("_update_precipitation", "stepPrecipitation", "private"),
|
||||
("_check_terrain_evolution", "stepTerrainEvolution", "HAND_WRITTEN"),
|
||||
("_check_terrain_evolution", "stepTerrainEvolution", "private"),
|
||||
("_compute_global_stats", "stepGlobalStats", "private"),
|
||||
("_clear_magic_deltas", "stepClearDeltas", "private"),
|
||||
]
|
||||
|
|
@ -918,9 +918,6 @@ def assemble(fns: dict[str, dict[str, str]]) -> str:
|
|||
if gd_name == "_apply_aerosol_forcing":
|
||||
parts.append(_emit_aerosol_forcing()) # hand-written — too complex for generic transpilation
|
||||
continue
|
||||
if gd_name == "_check_terrain_evolution":
|
||||
parts.append(_emit_terrain_evolution()) # hand-written — transpiler mishandles nested if/else
|
||||
continue
|
||||
if gd_name in climate_fns:
|
||||
body = climate_fns[gd_name]
|
||||
ts_body = transform_method_body(body, gd_name, defaults=CLIMATE_DEFAULTS, extra_removals=EXTRA_REMOVALS)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue