From 3c6654134b7958cae7b4221b33f006231d621e6c Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 17 Nov 2024 14:16:41 +0200 Subject: [PATCH] game: add private member annotations --- src/lib/Game.svelte.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/Game.svelte.ts b/src/lib/Game.svelte.ts index aa7f60f..14728d5 100644 --- a/src/lib/Game.svelte.ts +++ b/src/lib/Game.svelte.ts @@ -10,12 +10,12 @@ export type SaveGameId = { }; export class Game { - undo_stack: State[] = $state([]); - undo_index: number = $state(-1); - _save_game_slot: number = $state(0); + private undo_stack: State[] = $state([]); + private undo_index: number = $state(-1); + private _save_game_slot: number = $state(0); saved_games: SaveGameId[] = $state(); - static _save_game_name_slot(slot: number): string { + private static _save_game_name_slot(slot: number): string { return `groovescore-save-${slot}`; } @@ -23,7 +23,7 @@ export class Game { this._read_saved_games(); } - _read_saved_games(): void { + private _read_saved_games(): void { let saved: SaveGameId[] = []; for (let slot of [0,1,2]) { @@ -96,7 +96,7 @@ export class Game { this.undo_index++; } - _push(s: State = null): void { + private _push(s: State = null): void { if (s === null) s = this.state.deepcopy(); this.undo_stack.splice(++this.undo_index, this.undo_stack.length, s);