mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 16:52:34 +00:00
trying to build protos
This commit is contained in:
@@ -2,6 +2,8 @@ import {Jimp as JimpType, JimpConstructors} from '@jimp/core';
|
||||
import 'jimp';
|
||||
import {TerrainMap, TerrainType, TerrainTypes} from './Game';
|
||||
import {TerrainMapImpl} from './GameImpl';
|
||||
import {TerrainTile} from '../../generated/protos';
|
||||
|
||||
|
||||
declare const Jimp: JimpType & JimpConstructors;
|
||||
|
||||
@@ -14,6 +16,7 @@ export async function loadTerrainMap(): Promise<TerrainMap> {
|
||||
const terrain: TerrainType[][] = Array(width).fill(null).map(() => Array(height).fill(TerrainTypes.Water));
|
||||
|
||||
image.scan(0, 0, width, height, function (x: number, y: number, idx: number) {
|
||||
const t: TerrainTile = new TerrainTile()
|
||||
const red = this.bitmap.data[idx + 0];
|
||||
|
||||
if (red > 100) {
|
||||
|
||||
Reference in New Issue
Block a user