mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 22:44:17 +00:00
Enable the prefer-destructuring eslint rule (#1858)
## Description: Enable the `prefer-destructuring` eslint rule. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
This commit is contained in:
@@ -67,7 +67,7 @@ export class FakeHumanExecution implements Execution {
|
||||
}
|
||||
|
||||
private updateRelationsFromEmbargos() {
|
||||
const player = this.player;
|
||||
const { player } = this;
|
||||
if (player === null) return;
|
||||
const others = this.mg.players().filter((p) => p.id() !== player.id());
|
||||
|
||||
@@ -90,7 +90,7 @@ export class FakeHumanExecution implements Execution {
|
||||
}
|
||||
|
||||
private handleEmbargoesToHostileNations() {
|
||||
const player = this.player;
|
||||
const { player } = this;
|
||||
if (player === null) return;
|
||||
const others = this.mg.players().filter((p) => p.id() !== player.id());
|
||||
|
||||
@@ -248,7 +248,7 @@ export class FakeHumanExecution implements Execution {
|
||||
if (other.isTraitor()) {
|
||||
return false;
|
||||
}
|
||||
const difficulty = this.mg.config().gameConfig().difficulty;
|
||||
const { difficulty } = this.mg.config().gameConfig();
|
||||
if (
|
||||
difficulty === Difficulty.Hard ||
|
||||
difficulty === Difficulty.Impossible
|
||||
@@ -491,7 +491,7 @@ export class FakeHumanExecution implements Execution {
|
||||
private structureSpawnTileValue(type: UnitType): (tile: TileRef) => number {
|
||||
if (this.player === null) throw new Error("not initialized");
|
||||
const borderTiles = this.player.borderTiles();
|
||||
const mg = this.mg;
|
||||
const { mg } = this;
|
||||
const otherUnits = this.player.units(type);
|
||||
// Prefer spacing structures out of atom bomb range
|
||||
const borderSpacing = this.mg.config().nukeMagnitudes(UnitType.AtomBomb).outer;
|
||||
|
||||
Reference in New Issue
Block a user