mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 06:29:38 +00:00
NPCs create battleships, destroyers. start work on miniastar
This commit is contained in:
@@ -15,30 +15,12 @@ interface Coord {
|
||||
y: number;
|
||||
}
|
||||
|
||||
export class TerrainMap {
|
||||
constructor(public readonly tiles: Terrain[][]) { }
|
||||
|
||||
terrain(coord: Coord): Terrain {
|
||||
return this.tiles[coord.x][coord.y]
|
||||
}
|
||||
|
||||
|
||||
|
||||
width(): number {
|
||||
return this.tiles.length
|
||||
}
|
||||
|
||||
height(): number {
|
||||
return this.tiles[0].length
|
||||
}
|
||||
}
|
||||
|
||||
export enum TerrainType {
|
||||
enum TerrainType {
|
||||
Land,
|
||||
Water
|
||||
}
|
||||
|
||||
export class Terrain {
|
||||
class Terrain {
|
||||
public shoreline: boolean = false
|
||||
public magnitude: number = 0
|
||||
public ocean: boolean
|
||||
|
||||
Reference in New Issue
Block a user