mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:40:46 +00:00
fix unit not function error
This commit is contained in:
@@ -70,6 +70,10 @@ export class PlayerView {
|
||||
return this.game.worker.playerInteraction(this.id(), this.game.x(tile), this.game.y(tile))
|
||||
}
|
||||
|
||||
units(): UnitView[] {
|
||||
return this.game.units().filter(u => u.owner().smallID() == this.smallID())
|
||||
}
|
||||
|
||||
nameLocation(): NameViewData {
|
||||
return this.nameData
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Difficulty, GameType, Gold, Player, PlayerInfo, PlayerType, TerrainType, TerraNullius, Tick, UnitInfo, UnitType } from "../game/Game";
|
||||
import { GameMap, TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../GameView";
|
||||
import { GameConfig } from "../Schemas";
|
||||
import { assertNever, within } from "../Util";
|
||||
import { Config, ServerConfig, Theme } from "./Config";
|
||||
@@ -276,7 +277,7 @@ export class DefaultConfig implements Config {
|
||||
return 25000
|
||||
}
|
||||
|
||||
maxPopulation(player: Player): number {
|
||||
maxPopulation(player: Player | PlayerView): number {
|
||||
let maxPop = Math.pow(player.numTilesOwned(), .6) * 1000 + 50000
|
||||
if (player.type() == PlayerType.Bot) {
|
||||
return maxPop
|
||||
|
||||
Reference in New Issue
Block a user