mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 04:53:49 +00:00
feat: add warship tests (#291)
This commit is contained in:
@@ -25,6 +25,7 @@ class Terrain {
|
||||
|
||||
export async function generateMap(
|
||||
imageBuffer: Buffer,
|
||||
removeSmall = true,
|
||||
): Promise<{ map: Uint8Array; miniMap: Uint8Array }> {
|
||||
const stream = Readable.from(imageBuffer);
|
||||
const img = await decodePNGFromStream(stream);
|
||||
@@ -56,8 +57,10 @@ export async function generateMap(
|
||||
}
|
||||
}
|
||||
|
||||
removeSmallIslands(terrain);
|
||||
removeSmallLakes(terrain);
|
||||
if (removeSmall) {
|
||||
removeSmallIslands(terrain);
|
||||
removeSmallLakes(terrain);
|
||||
}
|
||||
const shorelineWaters = processShore(terrain);
|
||||
processDistToLand(shorelineWaters, terrain);
|
||||
processOcean(terrain);
|
||||
|
||||
Reference in New Issue
Block a user