mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 12:53:27 +00:00
Fix various ESLint violations (#402)
## Description: Fixes a number of ESLint violations. Although I have tested these changes through the local dev server, I don't have a high confidence that the testing is sufficient, as I am new to this codebase. This change would benefit from heightened scrutiny. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: fake.neo --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
@@ -137,8 +137,8 @@ export class Cell {
|
||||
private strRepr: string;
|
||||
|
||||
constructor(
|
||||
public readonly x,
|
||||
public readonly y,
|
||||
public readonly x: number,
|
||||
public readonly y: number,
|
||||
) {
|
||||
this.strRepr = `Cell[${this.x},${this.y}]`;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ export class GameImpl implements Game {
|
||||
}
|
||||
|
||||
addUpdate(update: GameUpdate) {
|
||||
(this.updates[update.type] as any[]).push(update);
|
||||
(this.updates[update.type] as GameUpdate[]).push(update);
|
||||
}
|
||||
|
||||
nextUnitID(): number {
|
||||
@@ -383,7 +383,7 @@ export class GameImpl implements Game {
|
||||
}
|
||||
|
||||
playerByClientID(id: ClientID): Player | null {
|
||||
for (const [pID, player] of this._players) {
|
||||
for (const [, player] of this._players) {
|
||||
if (player.clientID() == id) {
|
||||
return player;
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,7 @@ export class PlayerImpl implements Player {
|
||||
// It's a probability list, so if an element appears twice it's because it's
|
||||
// twice more likely to be picked later.
|
||||
tradingPorts(port: Unit): Unit[] {
|
||||
let ports = this.mg
|
||||
const ports = this.mg
|
||||
.players()
|
||||
.filter((p) => p != port.owner() && p.canTrade(port.owner()))
|
||||
.flatMap((p) => p.units(UnitType.Port))
|
||||
|
||||
Reference in New Issue
Block a user