mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:51:30 +00:00
has player.units filter by type
This commit is contained in:
@@ -22,12 +22,12 @@ export class DevConfig extends DefaultConfig {
|
||||
// return 100
|
||||
}
|
||||
|
||||
// unitInfo(type: UnitType): UnitInfo {
|
||||
// const info = super.unitInfo(type);
|
||||
// const oldCost = info.cost;
|
||||
// info.cost = (p: Player) => oldCost(p) / 1000000000;
|
||||
// return info;
|
||||
// }
|
||||
unitInfo(type: UnitType): UnitInfo {
|
||||
const info = super.unitInfo(type);
|
||||
const oldCost = info.cost;
|
||||
info.cost = (p: Player) => oldCost(p) / 1000000000;
|
||||
return info;
|
||||
}
|
||||
|
||||
// tradeShipSpawnRate(): number {
|
||||
// return 10;
|
||||
@@ -45,10 +45,10 @@ export class DevConfig extends DefaultConfig {
|
||||
// return 5000
|
||||
// }
|
||||
|
||||
// numBots(): number {
|
||||
// return 0
|
||||
// }
|
||||
// spawnNPCs(): boolean {
|
||||
// return false
|
||||
// }
|
||||
numBots(): number {
|
||||
return 0;
|
||||
}
|
||||
spawnNPCs(): boolean {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,9 +109,9 @@ export class PlayerView {
|
||||
);
|
||||
}
|
||||
|
||||
units(): UnitView[] {
|
||||
units(...types: UnitType[]): UnitView[] {
|
||||
return this.game
|
||||
.units()
|
||||
.units(...types)
|
||||
.filter((u) => u.owner().smallID() == this.smallID());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user