mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-04 21:57:22 +00:00
Enable the @typescript-eslint/prefer-readonly eslint rule (#1859)
## Description: Enable the `@typescript-eslint/prefer-readonly` 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:
@@ -31,10 +31,10 @@ type UnitRenderConfig = {
|
||||
export class StructureLayer implements Layer {
|
||||
private canvas: HTMLCanvasElement;
|
||||
private context: CanvasRenderingContext2D;
|
||||
private unitIcons: Map<string, HTMLImageElement> = new Map();
|
||||
private theme: Theme;
|
||||
private tempCanvas: HTMLCanvasElement;
|
||||
private tempContext: CanvasRenderingContext2D;
|
||||
private readonly unitIcons: Map<string, HTMLImageElement> = new Map();
|
||||
private readonly theme: Theme;
|
||||
private readonly tempCanvas: HTMLCanvasElement;
|
||||
private readonly tempContext: CanvasRenderingContext2D;
|
||||
|
||||
// Configuration for supported unit types only
|
||||
private readonly unitConfigs: Partial<Record<UnitType, UnitRenderConfig>> = {
|
||||
@@ -71,9 +71,9 @@ export class StructureLayer implements Layer {
|
||||
};
|
||||
|
||||
constructor(
|
||||
private game: GameView,
|
||||
private eventBus: EventBus,
|
||||
private transformHandler: TransformHandler,
|
||||
private readonly game: GameView,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly transformHandler: TransformHandler,
|
||||
) {
|
||||
this.theme = game.config().theme();
|
||||
this.tempCanvas = document.createElement("canvas");
|
||||
|
||||
Reference in New Issue
Block a user