mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-22 05:23:04 +00:00
improved terrain api
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Player, PlayerID, PlayerInfo, TerrainType, TerrainTypes, TerraNullius, Tile} from "../Game";
|
||||
import {Player, PlayerID, PlayerInfo, TerraNullius, Tile} from "../Game";
|
||||
import {Colord, colord} from "colord";
|
||||
import {devConfig} from "./DevConfig";
|
||||
import {defaultConfig} from "./DefaultConfig";
|
||||
@@ -41,7 +41,7 @@ export interface Theme {
|
||||
playerInfoColor(id: PlayerID): Colord;
|
||||
territoryColor(id: PlayerID): Colord;
|
||||
borderColor(id: PlayerID): Colord;
|
||||
terrainColor(tile: TerrainType): Colord;
|
||||
terrainColor(tile: Tile): Colord;
|
||||
backgroundColor(): Colord;
|
||||
font(): string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Colord, colord} from "colord";
|
||||
import {PlayerID, TerrainType, TerrainTypes} from "../Game";
|
||||
import {PlayerID, Tile} from "../Game";
|
||||
import {Theme} from "./Config";
|
||||
|
||||
export const pastelTheme = new class implements Theme {
|
||||
@@ -75,11 +75,12 @@ export const pastelTheme = new class implements Theme {
|
||||
})
|
||||
}
|
||||
|
||||
terrainColor(tile: TerrainType): Colord {
|
||||
if (tile == TerrainTypes.Land) {
|
||||
terrainColor(tile: Tile): Colord {
|
||||
if (tile.isLand()) {
|
||||
return this.land;
|
||||
} else {
|
||||
return this.water;
|
||||
}
|
||||
return this.water;
|
||||
}
|
||||
|
||||
backgroundColor(): Colord {
|
||||
|
||||
Reference in New Issue
Block a user