From 319934bb3aef89dc5f6ca07a300278df18a8c5f2 Mon Sep 17 00:00:00 2001 From: guiltygyoza <59590480+guiltygyoza@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:07:21 +0800 Subject: [PATCH] tabs --- examples/grid/src/objects/grid.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/grid/src/objects/grid.ts b/examples/grid/src/objects/grid.ts index 852da73f..2f43c07e 100644 --- a/examples/grid/src/objects/grid.ts +++ b/examples/grid/src/objects/grid.ts @@ -10,24 +10,24 @@ import { export class Grid implements CRO { operations: string[] = ["addUser", "moveUser"]; semanticsType: SemanticsType = SemanticsType.pair; - positions: Map; + positions: Map; constructor() { this.positions = new Map(); } - addUser(userId: string, color: string): void { - this._addUser(userId, color); - } + addUser(userId: string, color: string): void { + this._addUser(userId, color); + } private _addUser(userId: string, color: string): void { const userColorString = `${userId}:${color}`; this.positions.set(userColorString, {x: 0, y: 0}); } - moveUser(userId: string, direction: string): void { - this._moveUser(userId, direction); - } + moveUser(userId: string, direction: string): void { + this._moveUser(userId, direction); + } private _moveUser(userId: string, direction: string): void { const userColorString = [...this.positions.keys()].find(u => u.startsWith(`${userId}:`)); @@ -59,7 +59,7 @@ export class Grid implements CRO { getUserPosition(userColorString: string): { x: number, y: number } | undefined { const position = this.positions.get(userColorString); if (position) { - return position + return position; } return undefined; } @@ -69,10 +69,10 @@ export class Grid implements CRO { } mergeCallback(operations: Operation[]): void { - // reset this.positions - this.positions = new Map(); + // reset this.positions + this.positions = new Map(); - // apply operations to this.positions + // apply operations to this.positions for (const op of operations) { if (!op.value) continue; switch (op.type) { @@ -88,7 +88,7 @@ export class Grid implements CRO { } } } - } + } } export function createGrid(): Grid {