Remove unnecessary casts

This commit is contained in:
Scott Anderson
2025-04-03 01:35:29 -04:00
parent 7df6f271ed
commit 52542baa63
2 changed files with 2 additions and 4 deletions
-1
View File
@@ -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)) {
+2 -3
View File
@@ -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();
})