Skip to content

Commit

Permalink
game: add private member annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jnikula committed Nov 17, 2024
1 parent 2ac1093 commit 3c66541
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/Game.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ 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}`;
}

constructor() {
this._read_saved_games();
}

_read_saved_games(): void {
private _read_saved_games(): void {
let saved: SaveGameId[] = [];

for (let slot of [0,1,2]) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3c66541

Please sign in to comment.