mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 06:20:44 +00:00
added Mena
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,279 @@
|
||||
{
|
||||
"name": "MENA",
|
||||
"width": 2000,
|
||||
"height": 1000,
|
||||
"nations": [
|
||||
{
|
||||
"coordinates": [
|
||||
200,
|
||||
100
|
||||
],
|
||||
"name": "Spain 🇪🇸",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
50,
|
||||
135
|
||||
],
|
||||
"name": "Portugal 🇵🇹",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
125,
|
||||
375
|
||||
],
|
||||
"name": "Morocco 🇲🇦",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
425,
|
||||
300
|
||||
],
|
||||
"name": "Algeria 🇩🇿",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
600,
|
||||
275
|
||||
],
|
||||
"name": "Tunisia 🇹🇳",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
750,
|
||||
450
|
||||
],
|
||||
"name": "Libya 🇱🇾",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1200,
|
||||
450
|
||||
],
|
||||
"name": "Egypt 🇪🇬",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1333,
|
||||
333
|
||||
],
|
||||
"name": "Israel 🇮🇱",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1338,
|
||||
388
|
||||
],
|
||||
"name": "Palestine 🇵🇸",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1370,
|
||||
325
|
||||
],
|
||||
"name": "Lebanon 🇱🇧",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1228,
|
||||
728
|
||||
],
|
||||
"name": "Sudan 🇸🇩",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1450,
|
||||
275
|
||||
],
|
||||
"name": "Syria 🇸🇾",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1600,
|
||||
300
|
||||
],
|
||||
"name": "Iraq 🇮🇶",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1550,
|
||||
600
|
||||
],
|
||||
"name": "Saudi Arabia 🇸🇦",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1700,
|
||||
850
|
||||
],
|
||||
"name": "Yemen 🇾🇪",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1950,
|
||||
725
|
||||
],
|
||||
"name": "Oman 🇴🇲",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1950,
|
||||
600
|
||||
],
|
||||
"name": "UAE 🇦🇪",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1825,
|
||||
575
|
||||
],
|
||||
"name": "Qatar 🇶🇦",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1900,
|
||||
350
|
||||
],
|
||||
"name": "Iran 🇮🇷",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1300,
|
||||
150
|
||||
],
|
||||
"name": "Turkey 🇹🇷",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
675,
|
||||
50
|
||||
],
|
||||
"name": "Italy 🇮🇹",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
950,
|
||||
125
|
||||
],
|
||||
"name": "Greece 🇬🇷",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1000,
|
||||
25
|
||||
],
|
||||
"name": "Bulgaria 🇧🇬",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
2000,
|
||||
100
|
||||
],
|
||||
"name": "Turkmenistan 🇹🇲",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1400,
|
||||
400
|
||||
],
|
||||
"name": "Jordan 🇯🇴",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
875,
|
||||
725
|
||||
],
|
||||
"name": "Chad 🇹🇩",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
600,
|
||||
725
|
||||
],
|
||||
"name": "Niger 🇳🇪",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
300,
|
||||
750
|
||||
],
|
||||
"name": "Mali 🇲🇱",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
50,
|
||||
700
|
||||
],
|
||||
"name": "Mauritania 🇲🇷",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
950,
|
||||
925
|
||||
],
|
||||
"name": "Eritrea 🇪🇷",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1700,
|
||||
450
|
||||
],
|
||||
"name": "Kuwait 🇰🇼",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1550,
|
||||
25
|
||||
],
|
||||
"name": "Georgia 🇬🇪",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1750,
|
||||
125
|
||||
],
|
||||
"name": "Azerbaijan 🇦🇿",
|
||||
"strength": 1
|
||||
},
|
||||
{
|
||||
"coordinates": [
|
||||
1285,
|
||||
277
|
||||
],
|
||||
"name": "Cyprus 🇨🇾",
|
||||
"strength": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -21,7 +21,8 @@ export enum Difficulty {
|
||||
|
||||
export enum GameMap {
|
||||
World,
|
||||
Europe
|
||||
Europe,
|
||||
Mena
|
||||
}
|
||||
|
||||
export class Nation {
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import {Cell, GameMap, TerrainType} from './Game';
|
||||
import { Cell, GameMap, TerrainType } from './Game';
|
||||
import europeBin from "!!binary-loader!../../../resources/maps/Europe.bin";
|
||||
import europeInfo from "../../../resources/maps/Europe.json"
|
||||
|
||||
import worldBin from "!!binary-loader!../../../resources/maps/WorldMap.bin";
|
||||
import worldInfo from "../../../resources/maps/WorldMap.json"
|
||||
|
||||
import menaBin from "!!binary-loader!../../../resources/maps/Mena.bin"
|
||||
import menaInfo from "../../../resources/maps/Mena.json"
|
||||
|
||||
const maps = new Map()
|
||||
.set(GameMap.World, {bin: worldBin, info: worldInfo})
|
||||
.set(GameMap.Europe, {bin: europeBin, info: europeInfo});
|
||||
.set(GameMap.World, { bin: worldBin, info: worldInfo })
|
||||
.set(GameMap.Europe, { bin: europeBin, info: europeInfo })
|
||||
.set(GameMap.Mena, { bin: menaBin, info: menaInfo });
|
||||
|
||||
const loadedMaps = new Map<GameMap, TerrainMap>()
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {decodePNGFromStream} from 'pureimage'; import path from 'path';
|
||||
import { decodePNGFromStream } from 'pureimage'; import path from 'path';
|
||||
import fs from 'fs/promises';
|
||||
import {createReadStream} from 'fs';
|
||||
import {fileURLToPath} from 'url';
|
||||
import { createReadStream } from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const mapName = "Europe"
|
||||
const mapName = "Mena"
|
||||
|
||||
interface Coord {
|
||||
x: number;
|
||||
@@ -108,7 +108,7 @@ function processShore(map: Terrain[][]): Coord[] {
|
||||
} else {
|
||||
if (ns.filter(t => t.type == TerrainType.Land).length > 0) {
|
||||
terrain.shoreline = true
|
||||
shorelineWaters.push({x, y})
|
||||
shorelineWaters.push({ x, y })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ function processDistToLand(shorelineWaters: Coord[], map: Terrain[][]) {
|
||||
const newY = coord.y + dy;
|
||||
|
||||
if (newX >= 0 && newX < map.length && newY >= 0 && newY < map[0].length) {
|
||||
queue.push([{x: newX, y: newY}, distance + 1]);
|
||||
queue.push([{ x: newX, y: newY }, distance + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ function packTerrain(map: Terrain[][]): Uint8Array {
|
||||
}
|
||||
|
||||
function processOcean(map: Terrain[][]) {
|
||||
const queue: Coord[] = [{x: 0, y: 0}];
|
||||
const queue: Coord[] = [{ x: 0, y: 0 }];
|
||||
const visited = new Set<string>();
|
||||
|
||||
while (queue.length > 0) {
|
||||
@@ -220,7 +220,7 @@ function processOcean(map: Terrain[][]) {
|
||||
const newY = coord.y + dy;
|
||||
|
||||
if (newX >= 0 && newX < map.length && newY >= 0 && newY < map[0].length) {
|
||||
queue.push({x: newX, y: newY});
|
||||
queue.push({ x: newX, y: newY });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user