a bit less computation

This commit is contained in:
Gavin McDonald
2025-07-03 21:05:04 -04:00
parent 8cbf281ef8
commit d3eb6f1b46
4 changed files with 28 additions and 22 deletions

View File

@@ -157,7 +157,7 @@ export default class GameStore {
return this.gameUpdate(game);
}
tilt(playerID: string, cardIndex: number, { rotateX, rotateY }: Tilt) {
tilt(playerID: string, cardIndex: number, tilt: Tilt) {
const game = this.getGameByPlayerID(playerID);
const cardTilts = game.tilts[cardIndex];
@@ -165,8 +165,8 @@ export default class GameStore {
this._clearTilts(game, playerID);
if (rotateX && rotateY) {
game.tilts[cardIndex] = [...game.tilts[cardIndex], { playerID, rotateX, rotateY }];
if (tilt.rotateX && tilt.rotateY) {
game.tilts[cardIndex] = [...game.tilts[cardIndex], { ...tilt, playerID }];
game.lastUpdated = Date.now();
}