mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 05:54:33 +00:00
Remove unnecessary casts
This commit is contained in:
@@ -177,7 +177,6 @@ export class FakeHumanExecution implements Execution {
|
||||
|
||||
const enemies = enemiesWithTN
|
||||
.filter((o) => o.isPlayer())
|
||||
.map((o) => o as Player)
|
||||
.sort((a, b) => a.troops() - b.troops());
|
||||
|
||||
if (this.random.chance(20)) {
|
||||
|
||||
@@ -447,12 +447,12 @@ export class PlayerImpl implements Player {
|
||||
this.mg.target(this, other);
|
||||
}
|
||||
|
||||
targets(): PlayerImpl[] {
|
||||
targets(): Player[] {
|
||||
return this.targets_
|
||||
.filter(
|
||||
(t) => this.mg.ticks() - t.tick < this.mg.config().targetDuration(),
|
||||
)
|
||||
.map((t) => t.target as PlayerImpl);
|
||||
.map((t) => t.target);
|
||||
}
|
||||
|
||||
transitiveTargets(): Player[] {
|
||||
@@ -759,7 +759,6 @@ export class PlayerImpl implements Player {
|
||||
nukeSpawn(tile: TileRef): TileRef | false {
|
||||
// only get missilesilos that are not on cooldown
|
||||
const spawns = this.units(UnitType.MissileSilo)
|
||||
.map((u) => u as Unit)
|
||||
.filter((silo) => {
|
||||
return !silo.isCooldown();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user